增加商户转账到零钱v3版本

This commit is contained in:
2265829957@qq.com 2026-07-04 21:53:36 +08:00
parent 73f2d24816
commit 2b0eebdc0f
6 changed files with 193 additions and 1 deletions

View File

@ -1460,6 +1460,7 @@
ho.act_price as actPrice, ho.act_price as actPrice,
ho.act_power_price as actPowerPrice, ho.act_power_price as actPowerPrice,
ho.act_service_price as actServicePrice, ho.act_service_price as actServicePrice,
ho.act_total_price as actTotalPrice,
ho.internet_commission as internetCommission, ho.internet_commission as internetCommission,
ho.internet_svc_commission as internetSvcCommission, ho.internet_svc_commission as internetSvcCommission,
ho.internet_degree_commission as internetDegreeCommission, ho.internet_degree_commission as internetDegreeCommission,

View File

@ -90,6 +90,13 @@
<artifactId>okhttp</artifactId> <artifactId>okhttp</artifactId>
<version>3.14.9</version> <version>3.14.9</version>
</dependency> </dependency>
<dependency>
<groupId>com.github.wechatpay-apiv3</groupId>
<artifactId>wechatpay-java</artifactId>
<version>0.2.17</version>
</dependency>
</dependencies> </dependencies>
<build> <build>

View File

@ -3,6 +3,7 @@ package com.xhpc.payment.service;
import com.xhpc.common.core.domain.R; import com.xhpc.common.core.domain.R;
import com.xhpc.common.domain.XhpcRefundOrder; import com.xhpc.common.domain.XhpcRefundOrder;
import com.xhpc.payment.domain.XhpcRefundAudit; import com.xhpc.payment.domain.XhpcRefundAudit;
import com.xhpc.payment.util.TransferBatchNotifyData;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.util.Map; import java.util.Map;
@ -22,6 +23,10 @@ public interface IXhpcRefundOriginalOrderService {
//微信回调处理退款 //微信回调处理退款
void updateXhpcRefundOriginalOrder(Map<String, String> reqInfo); void updateXhpcRefundOriginalOrder(Map<String, String> reqInfo);
//微信回调处理V3退款
void updateXhpcRefundOriginalOrderV3(TransferBatchNotifyData notifyData);
void updateXhpcRefundOrder(XhpcRefundOrder refundOrder, BigDecimal refundFee, Integer type,Integer status); void updateXhpcRefundOrder(XhpcRefundOrder refundOrder, BigDecimal refundFee, Integer type,Integer status);
//新增退款订单 //新增退款订单

View File

@ -0,0 +1,79 @@
package com.xhpc.payment.util;
import com.google.gson.annotations.SerializedName;
/**
* 微信支付回调通知外层报文
* 对应 resource 加密前的原始 JSON
*/
public class TransferBatchCallbackNotification {
@SerializedName("id")
private String id;
@SerializedName("create_time")
private String createTime;
@SerializedName("resource_type")
private String resourceType;
@SerializedName("event_type")
private String eventType;
@SerializedName("summary")
private String summary;
@SerializedName("resource")
private Resource resource;
// ----- Getters and Setters -----
public String getId() { return id; }
public void setId(String id) { this.id = id; }
public String getCreateTime() { return createTime; }
public void setCreateTime(String createTime) { this.createTime = createTime; }
public String getResourceType() { return resourceType; }
public void setResourceType(String resourceType) { this.resourceType = resourceType; }
public String getEventType() { return eventType; }
public void setEventType(String eventType) { this.eventType = eventType; }
public String getSummary() { return summary; }
public void setSummary(String summary) { this.summary = summary; }
public Resource getResource() { return resource; }
public void setResource(Resource resource) { this.resource = resource; }
public static class Resource {
@SerializedName("original_type")
private String originalType;
@SerializedName("algorithm")
private String algorithm;
@SerializedName("ciphertext")
private String ciphertext;
@SerializedName("associated_data")
private String associatedData;
@SerializedName("nonce")
private String nonce;
// ----- Getters and Setters -----
public String getOriginalType() { return originalType; }
public void setOriginalType(String originalType) { this.originalType = originalType; }
public String getAlgorithm() { return algorithm; }
public void setAlgorithm(String algorithm) { this.algorithm = algorithm; }
public String getCiphertext() { return ciphertext; }
public void setCiphertext(String ciphertext) { this.ciphertext = ciphertext; }
public String getAssociatedData() { return associatedData; }
public void setAssociatedData(String associatedData) { this.associatedData = associatedData; }
public String getNonce() { return nonce; }
public void setNonce(String nonce) { this.nonce = nonce; }
}
}

View File

@ -0,0 +1,93 @@
package com.xhpc.payment.util;
import com.google.gson.annotations.SerializedName;
import java.util.List;
/**
* 微信商家转账批次回调通知数据
* 文档https://pay.weixin.qq.com/doc/v3/merchant/4012071382
*/
public class TransferBatchNotifyData {
@SerializedName("mchid")
private String mchid;
@SerializedName("out_batch_no")
private String outBatchNo;
@SerializedName("batch_id")
private String batchId;
@SerializedName("batch_status")
private String batchStatus; // FINISHED, CLOSED
@SerializedName("total_num")
private Integer totalNum;
@SerializedName("total_amount")
private Long totalAmount; // 单位
@SerializedName("transfer_detail_list")
private List<TransferDetail> transferDetailList;
// ----- Getter/Setter -----
public String getMchid() { return mchid; }
public void setMchid(String mchid) { this.mchid = mchid; }
public String getOutBatchNo() { return outBatchNo; }
public void setOutBatchNo(String outBatchNo) { this.outBatchNo = outBatchNo; }
public String getBatchId() { return batchId; }
public void setBatchId(String batchId) { this.batchId = batchId; }
public String getBatchStatus() { return batchStatus; }
public void setBatchStatus(String batchStatus) { this.batchStatus = batchStatus; }
public Integer getTotalNum() { return totalNum; }
public void setTotalNum(Integer totalNum) { this.totalNum = totalNum; }
public Long getTotalAmount() { return totalAmount; }
public void setTotalAmount(Long totalAmount) { this.totalAmount = totalAmount; }
public List<TransferDetail> getTransferDetailList() { return transferDetailList; }
public void setTransferDetailList(List<TransferDetail> transferDetailList) { this.transferDetailList = transferDetailList; }
public static class TransferDetail {
@SerializedName("detail_id")
private String detailId;
@SerializedName("out_detail_no")
private String outDetailNo;
@SerializedName("detail_status")
private String detailStatus; // SUCCESS, FAIL
@SerializedName("transfer_amount")
private Long transferAmount;
@SerializedName("openid")
private String openid;
@SerializedName("fail_reason")
private String failReason;
// ----- Getter/Setter -----
public String getDetailId() { return detailId; }
public void setDetailId(String detailId) { this.detailId = detailId; }
public String getOutDetailNo() { return outDetailNo; }
public void setOutDetailNo(String outDetailNo) { this.outDetailNo = outDetailNo; }
public String getDetailStatus() { return detailStatus; }
public void setDetailStatus(String detailStatus) { this.detailStatus = detailStatus; }
public Long getTransferAmount() { return transferAmount; }
public void setTransferAmount(Long transferAmount) { this.transferAmount = transferAmount; }
public String getOpenid() { return openid; }
public void setOpenid(String openid) { this.openid = openid; }
public String getFailReason() { return failReason; }
public void setFailReason(String failReason) { this.failReason = failReason; }
}
}

View File

@ -32,6 +32,13 @@
<result column="update_by" property="updateBy"/> <result column="update_by" property="updateBy"/>
<result column="remark" property="remark"/> <result column="remark" property="remark"/>
<result column="tenant_id" property="tenantId"/> <result column="tenant_id" property="tenantId"/>
<result column="wx_api_serial_no" property="wxApiSerialNo"/>
<result column="wx_api_v3_key" property="wxApiV3Key"/>
<result column="wx_pay_public_keyId" property="wxPayPublicKeyId"/>
<result column="wx_pay_public_key_path" property="wxPayPublicKeyPath"/>
<result column="wx_v3_callback_url" property="wxV3CallbackUrl"/>
</resultMap> </resultMap>
<select id="getXhpcSettingConfigTenantId" resultMap="XhpcSettingConfigResult"> <select id="getXhpcSettingConfigTenantId" resultMap="XhpcSettingConfigResult">