feat:位置付款码支付

This commit is contained in:
dzc committed 2025-06-06 14:42:08 +08:00
1 parent 3b0749da57
commit 6381c3be2f
22 files changed
+1257 -17

No files matched your search

@@ -24,6 +24,8 @@ public enum HardPayTypeEnum {
RESERVE_QR_CODE("7", "线上二维码支付"),
CASH("8", "现金支付"),
HARD_DOOR_FREE_PAY("9", "智能柜免密支付"),
WECHANT_SELF_QR_CODE_PAY("10", "微信付款码支付"),
ALI_SELF_QR_CODE_PAY("11", "支付宝付款码支付"),
;
private final String type;
private final String description;
@@ -36,7 +38,14 @@ public enum HardPayTypeEnum {
CASH
);
public static final List<HardPayTypeEnum> isNotPay = List.of(
public static final List<HardPayTypeEnum> isNotWalletPay = List.of(
STRIDE_DEPT_QR_CODE,
FOREIGN_TICKET_QR_CODE,
WECHANT_SELF_QR_CODE_PAY,
ALI_SELF_QR_CODE_PAY
);
public static final List<HardPayTypeEnum> isNeedCancel = List.of(
STRIDE_DEPT_QR_CODE,
FOREIGN_TICKET_QR_CODE
);
@@ -0,0 +1,28 @@
package com.bsd.pjcloud.hard.api.dto.wechat;
import lombok.Data;
@Data
public class WechatMicropayDto {
/**
* 商户id
*/
private Long merId;
/**
* 订单id
*/
private Long orderId;
/**
* 支付金额(分)
*/
private Long price;
/**
* 微信付款码code
*/
private String wechatQrCode;
}
@@ -0,0 +1,21 @@
package com.bsd.pjcloud.hard.api.dto.wechat;
import lombok.Data;
/**
* 查询订单入参
*/
@Data
public class WechatQueryDto {
/**
* 微信订单号
*/
private String wechantOrderId;
/**
* 商户订单号
*/
private String orderId;
}
@@ -0,0 +1,21 @@
package com.bsd.pjcloud.hard.api.dto.wechat;
import lombok.Data;
/**
* 退款入参
*/
@Data
public class WechatRefundDto {
private String orderId;
private String wechantOrderId;
private String refundId;
private Long orderPrice;
private Long refundPrice;
}
@@ -0,0 +1,17 @@
package com.bsd.pjcloud.hard.api.dto.wechat;
import lombok.Data;
/**
* 微信退款查询入参
*/
@Data
public class WechatRefundQueryDto {
/**
* 退款id
*/
private String refundId;
}
@@ -0,0 +1,30 @@
package com.bsd.pjcloud.hard.api.vo.wechat;
import lombok.Data;
/**
* 微信退款回调加密的返回参数
*/
@Data
public class WechantRefunCallbackSoureVo {
/**
* 公众账号ID
*/
private String appid;
/**
* 退款的商户号
*/
private String mch_id;
/**
* 随机字符串
*/
private String nonce_str;
/**
* 加密信息
*/
private String req_info;
}
@@ -0,0 +1,77 @@
package com.bsd.pjcloud.hard.api.vo.wechat;
import cn.hutool.core.util.ObjectUtil;
import lombok.Data;
/**
* 微信退款回调返回参数
*/
@Data
public class WechantRefunCallbackVo {
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[退款错误]]></return_msg>" +
"</xml>";
}
public static String wechantSuccess() {
return "<xml>" +
"<return_code><![CDATA[SUCCESS]]></return_code>" +
"<return_msg><![CDATA[退款成功]]></return_msg>" +
"</xml>";
}
}
@@ -0,0 +1,43 @@
package com.bsd.pjcloud.hard.api.vo.wechat;
import cn.hutool.core.util.ObjectUtil;
import lombok.Data;
@Data
public class WechatMicropayVo {
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;
public boolean isHttpSucess() {
return ObjectUtil.equals(WechatMicropayVo.SUCCESS, return_code);
}
public boolean isPaySucess() {
return ObjectUtil.equals(WechatMicropayVo.SUCCESS, result_code);
}
public boolean isAllSuccess(){
return isHttpSucess() && isPaySucess();
}
}
@@ -0,0 +1,125 @@
package com.bsd.pjcloud.hard.api.vo.wechat;
import cn.hutool.core.util.ObjectUtil;
import lombok.Data;
/**
* 查询订单返回
*/
@Data
public class WechatQueryVo {
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(WechatMicropayVo.SUCCESS, return_code);
}
public boolean isPaySucess() {
return ObjectUtil.equals(WechatMicropayVo.SUCCESS, result_code);
}
}
@@ -0,0 +1,102 @@
package com.bsd.pjcloud.hard.api.vo.wechat;
import cn.hutool.core.util.ObjectUtil;
import lombok.Data;
/**
* 退款返回
*/
@Data
public class WechatRefundQueryVo {
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(WechatMicropayVo.SUCCESS, err_code);
}
public boolean isPaySucess() {
return ObjectUtil.equals(WechatMicropayVo.SUCCESS, result_code);
}
}
@@ -0,0 +1,84 @@
package com.bsd.pjcloud.hard.api.vo.wechat;
import cn.hutool.core.util.ObjectUtil;
import lombok.Data;
/**
* 退款返回
*/
@Data
public class WechatRefundVo {
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(WechatMicropayVo.SUCCESS, return_code);
}
public boolean isPaySucess() {
return ObjectUtil.equals(WechatMicropayVo.SUCCESS, result_code);
}
public boolean isAllSuccess() {
return isHttpSucess() && isPaySucess();
}
}