超掌柜支付 参数初始化封装

SysParam增加缓存
This commit is contained in:
2025-02-12 15:11:44 +08:00
parent 88d44f0a77
commit 7000892d9b
15 changed files with 178 additions and 37 deletions

View File

@@ -27,6 +27,11 @@ public class CzgBaseReq {
private String currency = "cny";
/**
* 商户订单号 String(30)
* 操作方式+雪花算法
* 如 h5雪花ID
* 如 js雪花ID
* 如 lt雪花ID
* 如 refund雪花ID
*/
private String mchOrderNo;
/**
@@ -89,4 +94,20 @@ public class CzgBaseReq {
* 不传默认为不限制
*/
private Integer limitPay;
public CzgBaseReq() {
}
public CzgBaseReq(String storeId, String mchOrderNo, Long amount, String subject, String body,
String buyerRemark, String notifyUrl, String extParam) {
this.storeId = storeId;
this.mchOrderNo = mchOrderNo;
this.subject = subject;
this.body = body;
this.amount = amount;
this.buyerRemark = buyerRemark;
this.notifyUrl = notifyUrl;
this.extParam = extParam;
}
}

View File

@@ -3,6 +3,7 @@ package com.czg.entity.req;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NonNull;
/**
* h5支付请求参数
@@ -24,4 +25,13 @@ public class CzgH5PayReq extends CzgBaseReq{
*/
private String returnUrl;
public CzgH5PayReq(@NonNull String storeId, @NonNull String mchOrderNo,
@NonNull String subject, @NonNull Long amount, String body,
@NonNull String clientIp, @NonNull String notifyUrl,
String returnUrl, String buyerRemark, String extParam) {
super(subject, body, amount, mchOrderNo, storeId, buyerRemark, notifyUrl, extParam);
this.clientIp = clientIp;
this.returnUrl = returnUrl;
}
}

View File

@@ -3,6 +3,7 @@ package com.czg.entity.req;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NonNull;
/**
* 公众号/生活号/银联js支付
@@ -41,6 +42,7 @@ public class CzgJsPayReq extends CzgBaseReq {
* 支付结果同步跳转通知URL
*/
private String returnUrl;
/**
* 银联js支付成功前端跳转
*/
@@ -50,6 +52,15 @@ public class CzgJsPayReq extends CzgBaseReq {
*/
private String frontFailUrl;
public CzgJsPayReq(@NonNull String storeId, @NonNull String subAppid, @NonNull String mchOrderNo,
@NonNull String subject, @NonNull Long amount, String body,
@NonNull String userId, @NonNull String clientIp, @NonNull String notifyUrl,
String returnUrl, String buyerRemark, String extParam) {
super(subject, body, amount, mchOrderNo, storeId, buyerRemark, notifyUrl, extParam);
this.userId = userId;
this.clientIp = clientIp;
this.subAppid = subAppid;
this.returnUrl = returnUrl;
}
}

View File

@@ -3,22 +3,22 @@ package com.czg.entity.req;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NonNull;
/**
* 小程序支付
*
* @author ww
* 自有小程序拉起支付
* 自有小程序拉起服务商小程序,(微信)半屏小程序支付
* 半屏小程序需要在商户自己的小程序中的半屏小程序配置里面申请 否则会拉起全屏小程序支付
*
* <p>
* 半屏小程序支付适用场景是商户自己的小程序被纳入微信实物电商类型小程序导致间联商户无法绑定这类的小程序APPID
*/
@Data
@EqualsAndHashCode(callSuper = true)
public class CzgLtPayReq extends CzgBaseReq{
public class CzgLtPayReq extends CzgBaseReq {
//必填范围
/**
* 用户唯一标识 String(30)
@@ -50,4 +50,14 @@ public class CzgLtPayReq extends CzgBaseReq{
*/
private boolean isScreen;
public CzgLtPayReq(@NonNull String storeId, @NonNull String subAppid, @NonNull String mchOrderNo,
@NonNull String subject, @NonNull Long amount, String body,
@NonNull String userId, @NonNull String clientIp, @NonNull String notifyUrl,
String returnUrl, String buyerRemark, String extParam) {
super(storeId, mchOrderNo, amount, subject, body, buyerRemark, notifyUrl, extParam);
this.userId = userId;
this.clientIp = clientIp;
this.returnUrl = returnUrl;
this.subAppid = subAppid;
}
}

View File

@@ -3,6 +3,7 @@ package com.czg.entity.req;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NonNull;
/**
* 反扫请求参数
@@ -27,4 +28,13 @@ public class CzgMicroPayReq extends CzgBaseReq {
* 子商户appid ,微信付款支付的时候 需要上送
*/
private String subAppid;
public CzgMicroPayReq(@NonNull String storeId, @NonNull String subAppid, @NonNull String mchOrderNo,
@NonNull String subject, @NonNull Long amount, String body,
@NonNull String authCode, @NonNull String notifyUrl,
String buyerRemark, String extParam) {
super(storeId, mchOrderNo, amount, subject, body, buyerRemark, notifyUrl, extParam);
this.authCode = authCode;
this.subAppid = subAppid;
}
}

View File

@@ -1,6 +1,7 @@
package com.czg.entity.req;
import lombok.Data;
import lombok.NonNull;
/**
* @author ww
@@ -42,4 +43,17 @@ public class CzgRefundReq {
*/
private String notifyUrl;
/**
* payOrderId和mchOrderNo 二选一 必填
*/
public CzgRefundReq(@NonNull String mchRefundNo, @NonNull String refundReason, @NonNull Long refundAmount,
@NonNull String notifyUrl, String payOrderId, String mchOrderNo, String extParam) {
this.mchRefundNo = mchRefundNo;
this.refundReason = refundReason;
this.refundAmount = refundAmount;
this.payOrderId = payOrderId;
this.mchOrderNo = mchOrderNo;
this.extParam = extParam;
this.notifyUrl = notifyUrl;
}
}

View File

@@ -3,14 +3,16 @@ package com.czg.entity.req;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NonNull;
/**
* 正扫支付请求参数
*
* @author ww
*/
@Data
@EqualsAndHashCode(callSuper = true)
public class CzgScanPayReq extends CzgBaseReq{
public class CzgScanPayReq extends CzgBaseReq {
// 必填项
/**
* 用户IP 支付的用户IP
@@ -24,4 +26,12 @@ public class CzgScanPayReq extends CzgBaseReq{
*/
private String returnUrl;
public CzgScanPayReq(@NonNull String storeId, @NonNull String mchOrderNo,
@NonNull String subject, @NonNull Long amount, String body,
@NonNull String clientIp, @NonNull String notifyUrl,
String returnUrl, String buyerRemark, String extParam) {
super(storeId, mchOrderNo, amount, subject, body, buyerRemark, notifyUrl, extParam);
this.clientIp = clientIp;
this.returnUrl = returnUrl;
}
}

View File

@@ -1,9 +1,12 @@
package com.czg.entity.resp;
import lombok.Data;
/**
* @author ww
* @description
*/
@Data
public class CzgRefundResp {
/**
* 商户上送的退款订单号

View File

@@ -1,9 +1,12 @@
package com.czg.entity.resp.pay;
import lombok.Data;
/**
* @author ww
* @description h5支付参数
*/
@Data
public class CzgH5PayInfo {
/**
* 支付跳转地址

View File

@@ -1,10 +1,13 @@
package com.czg.entity.resp.pay;
import lombok.Data;
/**
* 扫码支付参数
* @author ww
* @description
*/
@Data
public class CzgScanPayInfo {
/**
* 付款二维码地址 qrCodeUrl