feat:app第三方支付
This commit is contained in:
1 parent
3aac5ab513
commit
13d912f0cb
54 files changed
+3034
-77
No files matched your search
+29
@@ -0,0 +1,29 @@
|
||||
package com.bsd.pjcloud.thirdparty.constant.miniplatform;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
||||
/**
|
||||
* 小程序平台登录错误
|
||||
*/
|
||||
@AllArgsConstructor
|
||||
@Getter
|
||||
public enum MiniPlatformLoginErrorEnum {
|
||||
|
||||
GET_PHONE_ERROR("10", "获取手机号错误"),
|
||||
USER_NOT_EXIST("20", "用户不存在"),
|
||||
LOGIN_ERROR("30", "登录错误"),
|
||||
;
|
||||
|
||||
private final String type;
|
||||
private final String description;
|
||||
|
||||
public static MiniPlatformLoginErrorEnum valueOfByType(String type) {
|
||||
if (ObjectUtil.isEmpty(type)) return null;
|
||||
return Arrays.stream(values()).filter(v -> ObjectUtil.equals(type, v.getType())).findFirst().get();
|
||||
}
|
||||
|
||||
}
|
||||
+29
@@ -0,0 +1,29 @@
|
||||
package com.bsd.pjcloud.thirdparty.constant.miniplatform;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.bsd.pjcloud.thirdparty.constant.ThirdKeyTypeEnum;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
||||
/**
|
||||
* 小程序平台
|
||||
*/
|
||||
@AllArgsConstructor
|
||||
@Getter
|
||||
public enum MiniPlatformTypeEnum {
|
||||
|
||||
WECHAT("10", "微信小程序"),
|
||||
ALI_PAY("20", "支付宝"),
|
||||
;
|
||||
|
||||
private final String type;
|
||||
private final String description;
|
||||
|
||||
public static MiniPlatformTypeEnum valueOfByType(String type) {
|
||||
if (ObjectUtil.isEmpty(type)) return null;
|
||||
return Arrays.stream(values()).filter(v -> ObjectUtil.equals(type, v.getType())).findFirst().get();
|
||||
}
|
||||
|
||||
}
|
||||
+27
@@ -0,0 +1,27 @@
|
||||
package com.bsd.pjcloud.thirdparty.constant.pay;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
||||
/**
|
||||
* 第三方支付业务类型
|
||||
*/
|
||||
@AllArgsConstructor
|
||||
@Getter
|
||||
public enum ThirdPayOrderBizTypeEnum {
|
||||
|
||||
MINI_APP_WALLET_RECHARGE("10", "小程序用户钱包充值"),
|
||||
;
|
||||
|
||||
private final String type;
|
||||
private final String description;
|
||||
|
||||
public static ThirdPayOrderBizTypeEnum valueOfByType(String type) {
|
||||
if (ObjectUtil.isEmpty(type)) return null;
|
||||
return Arrays.stream(values()).filter(v -> ObjectUtil.equals(type, v.getType())).findFirst().get();
|
||||
}
|
||||
|
||||
}
|
||||
+32
@@ -0,0 +1,32 @@
|
||||
package com.bsd.pjcloud.thirdparty.constant.pay;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
||||
/**
|
||||
* 第三方支付订单状态
|
||||
*/
|
||||
@AllArgsConstructor
|
||||
@Getter
|
||||
public enum ThirdPayOrderStatusEnum {
|
||||
PAY_UNPAID("10", "未支付"),
|
||||
PAY_SUCCESS("20", "支付成功"),
|
||||
PAY_FAILED("30", "已经支付"),
|
||||
|
||||
REFUNDING("100", "退款中"),
|
||||
REFUND_SUCCESS("200", "退款成功"),
|
||||
REFUND_FAILED("300", "退款失败"),
|
||||
;
|
||||
|
||||
private final String type;
|
||||
private final String description;
|
||||
|
||||
public static ThirdPayOrderStatusEnum valueOfByType(String type) {
|
||||
if (ObjectUtil.isEmpty(type)) return null;
|
||||
return Arrays.stream(values()).filter(v -> ObjectUtil.equals(type, v.getType())).findFirst().get();
|
||||
}
|
||||
|
||||
}
|
||||
+25
@@ -0,0 +1,25 @@
|
||||
package com.bsd.pjcloud.thirdparty.dto.appplus;
|
||||
|
||||
import com.bsd.pjcloud.thirdparty.constant.miniplatform.MiniPlatformTypeEnum;
|
||||
import jakarta.validation.constraints.NotEmpty;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class ThirdMiniAppGetUniqueDto {
|
||||
|
||||
/**
|
||||
* 小程序平台
|
||||
*/
|
||||
@NotNull(message = "小程序平台标识不能为空")
|
||||
private MiniPlatformTypeEnum miniPlatformType;
|
||||
|
||||
@NotEmpty(message = "code不能为空")
|
||||
private String code;
|
||||
|
||||
/**
|
||||
* 用户id
|
||||
*/
|
||||
private Long userId;
|
||||
|
||||
}
|
||||
+23
@@ -0,0 +1,23 @@
|
||||
package com.bsd.pjcloud.thirdparty.dto.appplus;
|
||||
|
||||
import com.bsd.pjcloud.thirdparty.constant.miniplatform.MiniPlatformTypeEnum;
|
||||
import jakarta.validation.constraints.NotEmpty;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class ThirdMiniAppOAth2LoginDto {
|
||||
|
||||
/**
|
||||
* 小程序平台
|
||||
*/
|
||||
@NotNull(message = "小程序平台标识不能为空")
|
||||
private MiniPlatformTypeEnum miniPlatformType;
|
||||
|
||||
@NotEmpty(message = "phoneCode不能为空")
|
||||
private String phoneCode;
|
||||
|
||||
@NotEmpty(message = "userCode不能为空")
|
||||
private String userCode;
|
||||
|
||||
}
|
||||
+42
@@ -0,0 +1,42 @@
|
||||
package com.bsd.pjcloud.thirdparty.dto.appplus;
|
||||
|
||||
import com.bsd.pjcloud.thirdparty.constant.miniplatform.MiniPlatformTypeEnum;
|
||||
import com.bsd.pjcloud.thirdparty.constant.pay.ThirdPayOrderBizTypeEnum;
|
||||
import jakarta.validation.constraints.NotEmpty;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class ThirdMiniAppPayDto {
|
||||
|
||||
/**
|
||||
* 充值业务类型
|
||||
*/
|
||||
@NotNull(message = "充值业务类型不能为空")
|
||||
private ThirdPayOrderBizTypeEnum bizType;
|
||||
|
||||
/**
|
||||
* 充值业务id
|
||||
*/
|
||||
@NotEmpty(message = "充值业务id不能为空")
|
||||
private String bizId;
|
||||
|
||||
|
||||
/**
|
||||
* 小程序平台
|
||||
*/
|
||||
@NotNull(message = "小程序平台标识不能为空")
|
||||
private MiniPlatformTypeEnum miniPlatformType;
|
||||
|
||||
/**
|
||||
* 金额(分)
|
||||
*/
|
||||
private Integer amount;
|
||||
|
||||
/**
|
||||
* 用户标识
|
||||
*/
|
||||
@NotEmpty(message = "用户标识不能为空")
|
||||
private String openId;
|
||||
|
||||
}
|
||||
+42
@@ -0,0 +1,42 @@
|
||||
package com.bsd.pjcloud.thirdparty.dto.appplus.pay.wechat;
|
||||
|
||||
import com.bsd.pjcloud.thirdparty.constant.pay.ThirdPayOrderBizTypeEnum;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* JSAPI/小程序下单
|
||||
*/
|
||||
@Data
|
||||
public class ThirdMiniJsapiPayDto {
|
||||
|
||||
/**
|
||||
* 充值业务类型
|
||||
*/
|
||||
private ThirdPayOrderBizTypeEnum bizType;
|
||||
|
||||
/**
|
||||
* 充值业务id
|
||||
*/
|
||||
private String bizId;
|
||||
|
||||
/**
|
||||
* 商户订单号
|
||||
*/
|
||||
private String outTradeNo;
|
||||
|
||||
/**
|
||||
* 用户id
|
||||
*/
|
||||
private Long userId;
|
||||
|
||||
/**
|
||||
* 用户标识
|
||||
*/
|
||||
private String openid;
|
||||
|
||||
/**
|
||||
* 金额(分)
|
||||
*/
|
||||
private Integer amount;
|
||||
|
||||
}
|
||||
+21
@@ -0,0 +1,21 @@
|
||||
package com.bsd.pjcloud.thirdparty.dto.appplus.pay.wechat;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* 撤销订单入参
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class ThirdMiniWechantReverseDto {
|
||||
|
||||
private Long orderId;
|
||||
|
||||
private String wechantOrderId;
|
||||
|
||||
}
|
||||
+21
@@ -0,0 +1,21 @@
|
||||
package com.bsd.pjcloud.thirdparty.dto.appplus.pay.wechat;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 查询订单入参
|
||||
*/
|
||||
@Data
|
||||
public class ThirdMiniWechatQueryDto {
|
||||
|
||||
/**
|
||||
* 微信订单号
|
||||
*/
|
||||
private String wechantOrderId;
|
||||
|
||||
/**
|
||||
* 商户订单号
|
||||
*/
|
||||
private String orderId;
|
||||
|
||||
}
|
||||
+26
@@ -0,0 +1,26 @@
|
||||
package com.bsd.pjcloud.thirdparty.dto.appplus.pay.wechat;
|
||||
|
||||
import jakarta.validation.constraints.NotEmpty;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* 退款入参
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class ThirdMiniWechatRefundDto {
|
||||
|
||||
@NotEmpty
|
||||
private String payNo;
|
||||
|
||||
/**
|
||||
* 为null就全额退款
|
||||
*/
|
||||
private Integer refundPrice;
|
||||
|
||||
}
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
package com.bsd.pjcloud.thirdparty.dto.appplus.pay.wechat;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 微信退款查询入参
|
||||
*/
|
||||
@Data
|
||||
public class ThirdMiniWechatRefundQueryDto {
|
||||
|
||||
/**
|
||||
* 退款id
|
||||
*/
|
||||
private String refundId;
|
||||
|
||||
}
|
||||
+15
@@ -0,0 +1,15 @@
|
||||
package com.bsd.pjcloud.thirdparty.dto.pay;
|
||||
|
||||
import com.bsd.pjcloud.thirdparty.entity.pay.ThirdPayOrderEntity;
|
||||
import lombok.Data;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
@Data
|
||||
public class ThirdPayOrderDto extends ThirdPayOrderEntity {
|
||||
|
||||
private LocalDateTime[] payTimeList;
|
||||
|
||||
private LocalDateTime[] refundTimeList;
|
||||
|
||||
}
|
||||
Vendored
Executable
+179
@@ -0,0 +1,179 @@
|
||||
package com.bsd.pjcloud.thirdparty.entity.pay;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import com.baomidou.mybatisplus.extension.activerecord.Model;
|
||||
import com.bsd.pjcloud.common.core.util.TenantTable;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* 第三方支付订单
|
||||
*/
|
||||
@Data
|
||||
@TenantTable
|
||||
@TableName("third_pay_order")
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Schema(description = "第三方支付订单")
|
||||
public class ThirdPayOrderEntity extends Model<ThirdPayOrderEntity> {
|
||||
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
@Schema(description = "主键")
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 支付平台类型
|
||||
*/
|
||||
@Schema(description = "支付平台类型")
|
||||
private String payPlatformType;
|
||||
|
||||
/**
|
||||
* 支付类型
|
||||
*/
|
||||
@Schema(description = "支付类型")
|
||||
private String bizType;
|
||||
|
||||
/**
|
||||
* 支付相关id
|
||||
*/
|
||||
@Schema(description = "支付相关id")
|
||||
private String bizId;
|
||||
|
||||
/**
|
||||
* 用户id
|
||||
*/
|
||||
@Schema(description = "用户id")
|
||||
private Long userId;
|
||||
|
||||
/**
|
||||
* 用户code
|
||||
*/
|
||||
@Schema(description = "用户code")
|
||||
private String userCode;
|
||||
|
||||
/**
|
||||
* 支付金额(分)
|
||||
*/
|
||||
@Schema(description = "支付金额(分)")
|
||||
private Integer price;
|
||||
|
||||
/**
|
||||
* 支付状态
|
||||
*/
|
||||
@Schema(description = "支付状态")
|
||||
private String status;
|
||||
|
||||
/**
|
||||
* 支付订单号
|
||||
*/
|
||||
@Schema(description = "支付订单号")
|
||||
private String payNo;
|
||||
|
||||
/**
|
||||
* 支付时间
|
||||
*/
|
||||
@Schema(description = "支付时间")
|
||||
private LocalDateTime payTime;
|
||||
|
||||
/**
|
||||
* 支付参数
|
||||
*/
|
||||
@Schema(description = "支付参数")
|
||||
private String payRep;
|
||||
|
||||
/**
|
||||
* 支付回调返回
|
||||
*/
|
||||
@Schema(description = "支付回调返回")
|
||||
private String payCallbackRes;
|
||||
|
||||
/**
|
||||
* 支付返回
|
||||
*/
|
||||
@Schema(description = "支付返回")
|
||||
private String payRes;
|
||||
|
||||
/**
|
||||
* 退款订单号
|
||||
*/
|
||||
@Schema(description = "退款订单号")
|
||||
private String refundNo;
|
||||
|
||||
/**
|
||||
* 退款回调返回
|
||||
*/
|
||||
@Schema(description = "退款回调返回")
|
||||
private String refundCallbackRes;
|
||||
|
||||
/**
|
||||
* 退款时间
|
||||
*/
|
||||
@Schema(description = "退款时间")
|
||||
private LocalDateTime refundTime;
|
||||
|
||||
/**
|
||||
* 退款参数
|
||||
*/
|
||||
@Schema(description = "退款参数")
|
||||
private String refundRep;
|
||||
|
||||
/**
|
||||
* 退款返回
|
||||
*/
|
||||
@Schema(description = "退款返回")
|
||||
private String refundRes;
|
||||
|
||||
/**
|
||||
* 订单过期时间
|
||||
*/
|
||||
@Schema(description = "订单过期时间")
|
||||
private LocalDateTime expireTime;
|
||||
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
@Schema(description = "创建人")
|
||||
private String createBy;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
@Schema(description = "创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
/**
|
||||
* 更新人
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||
@Schema(description = "更新人")
|
||||
private String updateBy;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||
@Schema(description = "更新时间")
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
/**
|
||||
* 删除时间
|
||||
*/
|
||||
@TableLogic
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
@Schema(description = "删除时间")
|
||||
private String delFlag;
|
||||
|
||||
/**
|
||||
* tenantId
|
||||
*/
|
||||
@Schema(description = "tenantId")
|
||||
private Long tenantId;
|
||||
}
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
package com.bsd.pjcloud.thirdparty.vo.appplus;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class ThirdMinAppOAth2LoginVo {
|
||||
|
||||
private Object accessToken;
|
||||
|
||||
private Object refreshToken;
|
||||
|
||||
private String errorCode;
|
||||
|
||||
}
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
package com.bsd.pjcloud.thirdparty.vo.appplus.pay;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
||||
@Data
|
||||
public class ThirdMiniAppPayVo {
|
||||
|
||||
private HashMap<String, Object> miniAppPayParams;
|
||||
|
||||
}
|
||||
+52
@@ -0,0 +1,52 @@
|
||||
package com.bsd.pjcloud.thirdparty.vo.appplus.pay.wechat;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
||||
/**
|
||||
* JSAPI/小程序下单
|
||||
*/
|
||||
@Data
|
||||
public class ThirdMiniJsapiPayVo {
|
||||
|
||||
public static final String SUCCESS = "SUCCESS";
|
||||
|
||||
private String return_code;
|
||||
|
||||
private String return_msg;
|
||||
|
||||
private String appid;
|
||||
|
||||
private String mch_id;
|
||||
|
||||
private String device_info;
|
||||
|
||||
private String nonce_str;
|
||||
|
||||
private String sign;
|
||||
|
||||
private String result_code;
|
||||
|
||||
private String err_code;
|
||||
|
||||
private String err_code_des;
|
||||
|
||||
private String trade_type;
|
||||
|
||||
private String prepay_id;
|
||||
|
||||
private String code_url;
|
||||
|
||||
private HashMap<String, Object> miniAppPayParams;
|
||||
|
||||
public boolean isHttpSucess() {
|
||||
return ObjectUtil.equals(ThirdMiniWechatQueryVo.SUCCESS, return_code);
|
||||
}
|
||||
|
||||
public boolean isPaySucess() {
|
||||
return ObjectUtil.equals(ThirdMiniWechatQueryVo.SUCCESS, result_code);
|
||||
}
|
||||
|
||||
}
|
||||
+30
@@ -0,0 +1,30 @@
|
||||
package com.bsd.pjcloud.thirdparty.vo.appplus.pay.wechat;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 微信退款回调加密的返回参数
|
||||
*/
|
||||
@Data
|
||||
public class ThirdMiniWechantRefunCallbackSoureVo {
|
||||
|
||||
/**
|
||||
* 公众账号ID
|
||||
*/
|
||||
private String appid;
|
||||
|
||||
/**
|
||||
* 退款的商户号
|
||||
*/
|
||||
private String mch_id;
|
||||
|
||||
/**
|
||||
* 随机字符串
|
||||
*/
|
||||
private String nonce_str;
|
||||
|
||||
/**
|
||||
* 加密信息
|
||||
*/
|
||||
private String req_info;
|
||||
}
|
||||
+77
@@ -0,0 +1,77 @@
|
||||
package com.bsd.pjcloud.thirdparty.vo.appplus.pay.wechat;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 微信退款回调返回参数
|
||||
*/
|
||||
@Data
|
||||
public class ThirdMiniWechantRefunCallbackVo {
|
||||
|
||||
public static final String SUCCESS_CODE = "SUCCESS";
|
||||
|
||||
/**
|
||||
* 微信订单号
|
||||
*/
|
||||
private String transaction_id;
|
||||
|
||||
/**
|
||||
* 商户订单号
|
||||
*/
|
||||
private String out_trade_no;
|
||||
|
||||
/**
|
||||
* 微信退款单号
|
||||
*/
|
||||
private String refund_id;
|
||||
|
||||
/**
|
||||
* 商户退款单号
|
||||
*/
|
||||
private String out_refund_no;
|
||||
|
||||
/**
|
||||
* 订单金额
|
||||
*/
|
||||
private String total_fee;
|
||||
|
||||
/**
|
||||
* 应结订单金额
|
||||
*/
|
||||
private String settlement_total_fee;
|
||||
|
||||
/**
|
||||
* 申请退款金额
|
||||
*/
|
||||
private String refund_fee;
|
||||
|
||||
/**
|
||||
* 退款金额
|
||||
*/
|
||||
private String settlement_refund_fee;
|
||||
|
||||
/**
|
||||
* 退款状态
|
||||
*/
|
||||
private String refund_status;
|
||||
|
||||
public boolean isAllSuccess() {
|
||||
return ObjectUtil.equals(refund_status, SUCCESS_CODE);
|
||||
}
|
||||
|
||||
public static String wechantError() {
|
||||
return "<xml>" +
|
||||
"<return_code><![CDATA[FAIL]]></return_code>" +
|
||||
"<return_msg><![CDATA[FAIL]]></return_msg>" +
|
||||
"</xml>";
|
||||
}
|
||||
|
||||
public static String wechantSuccess() {
|
||||
return "<xml>" +
|
||||
" <return_code><![CDATA[SUCCESS]]></return_code>" +
|
||||
" <return_msg><![CDATA[OK]]></return_msg>\n" +
|
||||
"</xml>";
|
||||
}
|
||||
|
||||
}
|
||||
+44
@@ -0,0 +1,44 @@
|
||||
package com.bsd.pjcloud.thirdparty.vo.appplus.pay.wechat;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 撤销订单返回
|
||||
*/
|
||||
@Data
|
||||
public class ThirdMiniWechantReverseVo {
|
||||
public static final String SUCCESS = "SUCCESS";
|
||||
|
||||
private String return_code;
|
||||
|
||||
private String return_msg;
|
||||
|
||||
private String appid;
|
||||
|
||||
private String mch_id;
|
||||
|
||||
private String nonce_str;
|
||||
|
||||
private String sign;
|
||||
|
||||
private String result_code;
|
||||
|
||||
private String err_code;
|
||||
|
||||
private String err_code_des;
|
||||
|
||||
private String recall;
|
||||
|
||||
public boolean isHttpSucess() {
|
||||
return ObjectUtil.equals(ThirdMiniWechantReverseVo.SUCCESS, return_code);
|
||||
}
|
||||
|
||||
public boolean isPaySucess() {
|
||||
return ObjectUtil.equals(ThirdMiniWechantReverseVo.SUCCESS, result_code);
|
||||
}
|
||||
|
||||
public boolean isAllSuccess() {
|
||||
return isHttpSucess() && isPaySucess();
|
||||
}
|
||||
}
|
||||
+140
@@ -0,0 +1,140 @@
|
||||
package com.bsd.pjcloud.thirdparty.vo.appplus.pay.wechat;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 查询订单返回
|
||||
*/
|
||||
@Data
|
||||
public class ThirdMiniWechatQueryVo {
|
||||
public static final String SUCCESS = "SUCCESS";
|
||||
|
||||
private String return_code;
|
||||
|
||||
private String return_msg;
|
||||
|
||||
private String appid;
|
||||
|
||||
private String mch_id;
|
||||
|
||||
private String nonce_str;
|
||||
|
||||
private String sign;
|
||||
|
||||
private String result_code;
|
||||
|
||||
private String err_code;
|
||||
|
||||
private String err_code_des;
|
||||
|
||||
private String device_info;
|
||||
|
||||
/**
|
||||
* 用户标识
|
||||
*/
|
||||
private String openid;
|
||||
|
||||
/**
|
||||
* 是否关注公众账号
|
||||
*/
|
||||
private String is_subscribe;
|
||||
|
||||
/**
|
||||
* 交易类型
|
||||
*/
|
||||
private String trade_type;
|
||||
|
||||
/**
|
||||
* 交易状态
|
||||
*/
|
||||
private String trade_state;
|
||||
|
||||
/**
|
||||
* 付款银行
|
||||
*/
|
||||
private String bank_type;
|
||||
|
||||
/**
|
||||
* 标价金额
|
||||
*/
|
||||
private String total_fee;
|
||||
|
||||
/**
|
||||
* 应结订单金额
|
||||
*/
|
||||
private String settlement_total_fee;
|
||||
|
||||
/**
|
||||
* 标价币种
|
||||
*/
|
||||
private String fee_type;
|
||||
|
||||
/**
|
||||
* 现金支付金额
|
||||
*/
|
||||
private String cash_fee;
|
||||
|
||||
/**
|
||||
* 现金支付币种
|
||||
*/
|
||||
private String cash_fee_type;
|
||||
|
||||
/**
|
||||
* 代金券金额
|
||||
*/
|
||||
private String coupon_fee;
|
||||
|
||||
/**
|
||||
* 代金券使用数量
|
||||
*/
|
||||
private String coupon_count;
|
||||
|
||||
/**
|
||||
* 微信支付订单号
|
||||
*/
|
||||
private String transaction_id;
|
||||
|
||||
/**
|
||||
* 商户订单号
|
||||
*/
|
||||
private String out_trade_no;
|
||||
|
||||
/**
|
||||
* 附加数据
|
||||
*/
|
||||
private String attach;
|
||||
|
||||
/**
|
||||
* 支付完成时间
|
||||
*/
|
||||
private String time_end;
|
||||
|
||||
/**
|
||||
* 交易状态描述
|
||||
*/
|
||||
private String trade_state_desc;
|
||||
|
||||
public boolean isHttpSucess() {
|
||||
return ObjectUtil.equals(ThirdMiniWechatQueryVo.SUCCESS, return_code);
|
||||
}
|
||||
|
||||
public boolean isPaySucess() {
|
||||
return ObjectUtil.equals(ThirdMiniWechatQueryVo.SUCCESS, result_code);
|
||||
}
|
||||
|
||||
public static String wechantError() {
|
||||
return "<xml>" +
|
||||
"<return_code><![CDATA[FAIL]]></return_code>" +
|
||||
"<return_msg><![CDATA[FAIL]]></return_msg>" +
|
||||
"</xml>";
|
||||
}
|
||||
|
||||
public static String wechantSuccess() {
|
||||
return "<xml>" +
|
||||
" <return_code><![CDATA[SUCCESS]]></return_code>" +
|
||||
" <return_msg><![CDATA[OK]]></return_msg>\n" +
|
||||
"</xml>";
|
||||
}
|
||||
|
||||
}
|
||||
+116
@@ -0,0 +1,116 @@
|
||||
package com.bsd.pjcloud.thirdparty.vo.appplus.pay.wechat;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 退款返回
|
||||
*/
|
||||
@Data
|
||||
public class ThirdMiniWechatRefundQueryVo {
|
||||
|
||||
public static final String SUCCESS = "SUCCESS";
|
||||
|
||||
/**
|
||||
* 业务结果
|
||||
*/
|
||||
private String result_code;
|
||||
|
||||
/**
|
||||
* 错误码
|
||||
*/
|
||||
private String err_code;
|
||||
|
||||
/**
|
||||
* 错误描述
|
||||
*/
|
||||
private String err_code_des;
|
||||
|
||||
/**
|
||||
* 公众账号ID
|
||||
*/
|
||||
private String appid;
|
||||
|
||||
/**
|
||||
* 商户号
|
||||
*/
|
||||
private String mch_id;
|
||||
|
||||
/**
|
||||
* 随机字符串
|
||||
*/
|
||||
private String nonce_str;
|
||||
|
||||
/**
|
||||
* 签名
|
||||
*/
|
||||
private String sign;
|
||||
|
||||
/**
|
||||
* 订单总退款次数
|
||||
*/
|
||||
private Long total_refund_count;
|
||||
|
||||
/**
|
||||
* 微信订单号
|
||||
*/
|
||||
private String transaction_id;
|
||||
|
||||
/**
|
||||
* 商户订单号
|
||||
*/
|
||||
private String out_trade_no;
|
||||
|
||||
/**
|
||||
* 订单金额
|
||||
*/
|
||||
private Long total_fee;
|
||||
|
||||
/**
|
||||
* 应结订单金额
|
||||
*/
|
||||
private Long settlement_total_fee;
|
||||
|
||||
/**
|
||||
* 货币种类
|
||||
*/
|
||||
private String fee_type;
|
||||
|
||||
/**
|
||||
* 现金支付金额
|
||||
*/
|
||||
private Long cash_fee;
|
||||
|
||||
/**
|
||||
* 退款笔数
|
||||
*/
|
||||
private Long refund_count;
|
||||
|
||||
/**
|
||||
* 退款总金额
|
||||
*/
|
||||
private Long refund_fee;
|
||||
|
||||
public boolean isHttpSucess() {
|
||||
return ObjectUtil.equals(ThirdMiniWechatRefundQueryVo.SUCCESS, err_code) || ObjectUtil.isEmpty(err_code);
|
||||
}
|
||||
|
||||
public boolean isPaySucess() {
|
||||
return ObjectUtil.equals(ThirdMiniWechatRefundQueryVo.SUCCESS, result_code);
|
||||
}
|
||||
|
||||
public static String wechantError() {
|
||||
return "<xml>" +
|
||||
"<return_code><![CDATA[FAIL]]></return_code>" +
|
||||
"<return_msg><![CDATA[FAIL]]></return_msg>" +
|
||||
"</xml>";
|
||||
}
|
||||
|
||||
public static String wechantSuccess() {
|
||||
return "<xml>" +
|
||||
" <return_code><![CDATA[SUCCESS]]></return_code>" +
|
||||
" <return_msg><![CDATA[OK]]></return_msg>\n" +
|
||||
"</xml>";
|
||||
}
|
||||
|
||||
}
|
||||
+84
@@ -0,0 +1,84 @@
|
||||
package com.bsd.pjcloud.thirdparty.vo.appplus.pay.wechat;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 退款返回
|
||||
*/
|
||||
@Data
|
||||
public class ThirdMiniWechatRefundVo {
|
||||
|
||||
public static final String SUCCESS = "SUCCESS";
|
||||
|
||||
private String return_code;
|
||||
|
||||
private String return_msg;
|
||||
|
||||
private String result_code;
|
||||
|
||||
private String err_code;
|
||||
|
||||
private String err_code_des;
|
||||
|
||||
private String appid;
|
||||
|
||||
private String mch_id;
|
||||
|
||||
private String nonce_str;
|
||||
|
||||
|
||||
private String sign;
|
||||
|
||||
/**
|
||||
* 微信支付订单号
|
||||
*/
|
||||
private String transaction_id;
|
||||
|
||||
/**
|
||||
* 商户订单号
|
||||
*/
|
||||
private String out_trade_no;
|
||||
|
||||
/**
|
||||
* 商户退款单号
|
||||
*/
|
||||
private String out_refund_no;
|
||||
|
||||
/**
|
||||
* 微信退款单号
|
||||
*/
|
||||
private String refund_id;
|
||||
|
||||
/**
|
||||
* 退款金额
|
||||
*/
|
||||
private String refund_fee;
|
||||
|
||||
/**
|
||||
* 应结退款金额
|
||||
*/
|
||||
private String settlement_refund_fee;
|
||||
|
||||
/**
|
||||
* 标价金额
|
||||
*/
|
||||
private String total_fee;
|
||||
|
||||
/**
|
||||
* 应结订单金额
|
||||
*/
|
||||
private String settlement_total_fee;
|
||||
|
||||
public boolean isHttpSucess() {
|
||||
return ObjectUtil.equals(ThirdMiniWechatRefundVo.SUCCESS, return_code);
|
||||
}
|
||||
|
||||
public boolean isPaySucess() {
|
||||
return ObjectUtil.equals(ThirdMiniWechatRefundVo.SUCCESS, result_code);
|
||||
}
|
||||
|
||||
public boolean isAllSuccess() {
|
||||
return isHttpSucess() && isPaySucess();
|
||||
}
|
||||
}
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
package com.bsd.pjcloud.thirdparty.vo.pay;
|
||||
|
||||
import com.bsd.pjcloud.thirdparty.entity.pay.ThirdPayOrderEntity;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class ThirdPayOrderVo extends ThirdPayOrderEntity {
|
||||
|
||||
private String username;
|
||||
|
||||
private String userPhone;
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user