mirror of
https://gitee.com/egzosn/pay-java-parent.git
synced 2026-05-31 21:09:40 +08:00
新增订单关闭方法
This commit is contained in:
@@ -6,6 +6,7 @@ import java.util.Date;
|
||||
import java.util.Map;
|
||||
|
||||
import com.egzosn.pay.common.bean.BillType;
|
||||
import com.egzosn.pay.common.bean.CloseOrder;
|
||||
import com.egzosn.pay.common.bean.MethodType;
|
||||
import com.egzosn.pay.common.bean.NoticeParams;
|
||||
import com.egzosn.pay.common.bean.NoticeRequest;
|
||||
@@ -218,8 +219,17 @@ public interface PayService<PC extends PayConfigStorage> {
|
||||
* @param tradeNo 支付平台订单号
|
||||
* @param outTradeNo 商户单号
|
||||
* @return 返回支付方交易关闭后的结果
|
||||
* @see #close(CloseOrder)
|
||||
*/
|
||||
@Deprecated
|
||||
Map<String, Object> close(String tradeNo, String outTradeNo);
|
||||
/**
|
||||
* 交易关闭接口
|
||||
*
|
||||
* @param closeOrder 关闭订单
|
||||
* @return 返回支付方交易关闭后的结果
|
||||
*/
|
||||
Map<String, Object> close(CloseOrder closeOrder);
|
||||
|
||||
|
||||
/**
|
||||
|
||||
@@ -0,0 +1,92 @@
|
||||
package com.egzosn.pay.common.bean;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 关闭订单
|
||||
* @author Egan
|
||||
* @email egan@egzosn.com
|
||||
* @date 2021/10/6
|
||||
*/
|
||||
public class CloseOrder implements Order {
|
||||
|
||||
/**
|
||||
* 支付平台订单号,交易号
|
||||
*/
|
||||
private String tradeNo;
|
||||
/**
|
||||
* 商户单号
|
||||
*/
|
||||
private String outTradeNo;
|
||||
|
||||
|
||||
/**
|
||||
* 订单附加信息,可用于预设未提供的参数,这里会覆盖以上所有的订单信息,
|
||||
*/
|
||||
private Map<String, Object> attr;
|
||||
|
||||
public CloseOrder() {
|
||||
}
|
||||
|
||||
public CloseOrder(String outTradeNo) {
|
||||
this.outTradeNo = outTradeNo;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 添加订单信息
|
||||
*
|
||||
* @param key key
|
||||
* @param value 值
|
||||
*/
|
||||
@Override
|
||||
public void addAttr(String key, Object value) {
|
||||
attr.put(key, value);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取属性 这里可用做覆盖已设置的信息属性,订单信息在签名前进行覆盖。
|
||||
*
|
||||
* @return 属性
|
||||
*/
|
||||
@Override
|
||||
public Map<String, Object> getAttrs() {
|
||||
return attr;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取属性 这里可用做覆盖已设置的订单信息属性,订单信息在签名前进行覆盖。
|
||||
*
|
||||
* @param key 属性名
|
||||
* @return 属性
|
||||
*/
|
||||
@Override
|
||||
public Object getAttr(String key) {
|
||||
return attr.get(key);
|
||||
}
|
||||
|
||||
public String getTradeNo() {
|
||||
return tradeNo;
|
||||
}
|
||||
|
||||
public void setTradeNo(String tradeNo) {
|
||||
this.tradeNo = tradeNo;
|
||||
}
|
||||
|
||||
public String getOutTradeNo() {
|
||||
return outTradeNo;
|
||||
}
|
||||
|
||||
public void setOutTradeNo(String outTradeNo) {
|
||||
this.outTradeNo = outTradeNo;
|
||||
}
|
||||
|
||||
public Map<String, Object> getAttr() {
|
||||
return attr;
|
||||
}
|
||||
|
||||
public void setAttr(Map<String, Object> attr) {
|
||||
this.attr = attr;
|
||||
}
|
||||
}
|
||||
@@ -1,11 +1,14 @@
|
||||
package com.egzosn.pay.common.bean;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.Map;
|
||||
|
||||
import com.egzosn.pay.common.util.DateUtils;
|
||||
import com.egzosn.pay.common.util.str.StringUtils;
|
||||
|
||||
/**
|
||||
* 订单参数构造器
|
||||
*
|
||||
* @author Egan
|
||||
* <pre>
|
||||
* email egzosn@gmail.com
|
||||
@@ -32,4 +35,9 @@ public final class OrderParaStructure {
|
||||
return parameters;
|
||||
}
|
||||
|
||||
public static Map<String, Object> loadDateParameters(Map<String, Object> parameters, String key, Order order, String datePattern) {
|
||||
return OrderParaStructure.loadParameters(parameters, key, DateUtils.formatDate((Date) order.getAttr(key), datePattern));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -48,10 +48,12 @@ public class PayOrder implements Order {
|
||||
/**
|
||||
* 设备信息
|
||||
*/
|
||||
@Deprecated
|
||||
private String deviceInfo;
|
||||
/**
|
||||
* 支付创建ip
|
||||
*/
|
||||
@Deprecated
|
||||
private String spbillCreateIp;
|
||||
/**
|
||||
* 付款条码串,人脸凭证,有关支付代码相关的,
|
||||
|
||||
@@ -58,6 +58,7 @@ public final class DateUtils {
|
||||
}
|
||||
|
||||
public static final String YYYY_MM_DD_HH_MM_SS = "yyyy-MM-dd HH:mm:ss";
|
||||
public static final String YYYY_MM_DD_T_HH_MM_SS = "yyyy-MM-dd'T'HH:mm:ss.SSSXXX";
|
||||
public static final String YYYY_MM_DD = "yyyy-MM-dd";
|
||||
public static final String YYYYMMDD = "yyyyMMdd";
|
||||
public static final String YYYYMMDDHHMMSS = "yyyyMMddHHmmss";
|
||||
|
||||
Reference in New Issue
Block a user