mirror of
https://gitee.com/egzosn/pay-java-parent.git
synced 2026-05-08 03:56:48 +08:00
移除过时的退款方法
This commit is contained in:
@@ -15,8 +15,10 @@ import com.egzosn.pay.common.util.DateUtils;
|
||||
import com.egzosn.pay.common.util.Util;
|
||||
import com.egzosn.pay.common.util.sign.SignUtils;
|
||||
import com.egzosn.pay.common.util.str.StringUtils;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.*;
|
||||
import java.util.Date;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.Map;
|
||||
import java.util.TreeMap;
|
||||
|
||||
/**
|
||||
* 支付宝支付服务
|
||||
@@ -407,24 +409,6 @@ public class AliPayService extends BasePayService<AliPayConfigStorage> {
|
||||
return secondaryInterface(tradeNo, outTradeNo, AliTransactionType.CANCEL);
|
||||
}
|
||||
|
||||
/**
|
||||
* 申请退款接口
|
||||
* 废弃
|
||||
*
|
||||
* @param tradeNo 支付平台订单号
|
||||
* @param outTradeNo 商户单号
|
||||
* @param refundAmount 退款金额
|
||||
* @param totalAmount 总金额
|
||||
* @return 返回支付方申请退款后的结果
|
||||
* @see #refund(RefundOrder, com.egzosn.pay.common.api.Callback)
|
||||
* @deprecated 版本替代 {@link #refund(RefundOrder, com.egzosn.pay.common.api.Callback)}
|
||||
*/
|
||||
@Deprecated
|
||||
@Override
|
||||
public Map<String, Object> refund(String tradeNo, String outTradeNo, BigDecimal refundAmount, BigDecimal totalAmount) {
|
||||
return refund(new RefundOrder(tradeNo, outTradeNo, refundAmount, totalAmount));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 申请退款接口
|
||||
@@ -449,17 +433,6 @@ public class AliPayService extends BasePayService<AliPayConfigStorage> {
|
||||
return requestTemplate.getForObject(getReqUrl() + "?" + UriVariables.getMapToParameters(parameters), JSONObject.class);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询退款
|
||||
*
|
||||
* @param tradeNo 支付平台订单号
|
||||
* @param outTradeNo 商户单号
|
||||
* @return 返回支付方查询退款后的结果
|
||||
*/
|
||||
@Override
|
||||
public Map<String, Object> refundquery(String tradeNo, String outTradeNo) {
|
||||
return secondaryInterface(tradeNo, outTradeNo, AliTransactionType.REFUNDQUERY);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询退款
|
||||
|
||||
@@ -310,24 +310,7 @@ public class BaiduPayService extends BasePayService<BaiduPayConfigStorage> {
|
||||
public Map<String, Object> close(String tradeNo, String outTradeNo) {
|
||||
throw new UnsupportedOperationException("不支持该操作");
|
||||
}
|
||||
|
||||
/**
|
||||
* 退款, 请使用 {@link com.egzosn.pay.baidu.api.BaiduPayService#refundUseBaidu}
|
||||
*
|
||||
* @param orderId
|
||||
* @param userId
|
||||
* @param refundAmount 退款金额
|
||||
* @param totalAmount 总金额
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
@Deprecated
|
||||
public Map<String, Object> refund(String orderId,
|
||||
String userId,
|
||||
BigDecimal refundAmount,
|
||||
BigDecimal totalAmount) {
|
||||
throw new UnsupportedOperationException("请使用 " + getClass().getName() + "#refundUseBaidu");
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 退款
|
||||
@@ -381,26 +364,7 @@ public class BaiduPayService extends BasePayService<BaiduPayConfigStorage> {
|
||||
return requestTemplate.getForObject(String.format("%s?%s", getReqUrl(transactionType), UriVariables.getMapToParameters(parameters)), JSONObject.class);
|
||||
}
|
||||
|
||||
/**
|
||||
* 退费查询
|
||||
*
|
||||
* @param orderId 百度平台订单ID
|
||||
* @param userId 百度用户ID
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public Map<String, Object> refundquery(String orderId,
|
||||
String userId) {
|
||||
Map<String, Object> parameters = getUseQueryPay();
|
||||
BaiduTransactionType transactionType = BaiduTransactionType.REFUND_QUERY;
|
||||
parameters.put(METHOD, transactionType.getMethod());
|
||||
parameters.put(TYPE, 3);
|
||||
parameters.put(ORDER_ID, orderId);
|
||||
parameters.put(USER_ID, userId);
|
||||
parameters.put(APP_KEY, payConfigStorage.getAppKey());
|
||||
parameters.put(RSA_SIGN, getRsaSign(parameters, RSA_SIGN));
|
||||
return requestTemplate.getForObject(String.format("%s?%s", getReqUrl(transactionType), UriVariables.getMapToParameters(parameters)), JSONObject.class);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 退费查询
|
||||
@@ -410,7 +374,16 @@ public class BaiduPayService extends BasePayService<BaiduPayConfigStorage> {
|
||||
*/
|
||||
@Override
|
||||
public Map<String, Object> refundquery(RefundOrder refundOrder) {
|
||||
return refundquery(refundOrder.getTradeNo(), refundOrder.getOutTradeNo());
|
||||
|
||||
Map<String, Object> parameters = getUseQueryPay();
|
||||
BaiduTransactionType transactionType = BaiduTransactionType.REFUND_QUERY;
|
||||
parameters.put(METHOD, transactionType.getMethod());
|
||||
parameters.put(TYPE, 3);
|
||||
parameters.put(ORDER_ID, refundOrder.getTradeNo());
|
||||
parameters.put(USER_ID, refundOrder.getUserId());
|
||||
parameters.put(APP_KEY, payConfigStorage.getAppKey());
|
||||
parameters.put(RSA_SIGN, getRsaSign(parameters, RSA_SIGN));
|
||||
return requestTemplate.getForObject(String.format("%s?%s", getReqUrl(transactionType), UriVariables.getMapToParameters(parameters)), JSONObject.class);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -242,24 +242,7 @@ public abstract class BasePayService<PC extends PayConfigStorage> implements Pay
|
||||
return Collections.EMPTY_MAP;
|
||||
}
|
||||
|
||||
/**
|
||||
* 退款
|
||||
*
|
||||
* @param tradeNo 支付平台订单号
|
||||
* @param outTradeNo 商户单号
|
||||
* @param refundAmount 退款金额
|
||||
* @param totalAmount 总金额
|
||||
* @param callback 处理器
|
||||
* @param <T> 返回类型
|
||||
* @return 处理过后的类型对象, 返回支付方申请退款后的结果
|
||||
* @see #refund(RefundOrder, Callback)
|
||||
*/
|
||||
@Deprecated
|
||||
@Override
|
||||
public <T> T refund(String tradeNo, String outTradeNo, BigDecimal refundAmount, BigDecimal totalAmount, Callback<T> callback) {
|
||||
|
||||
return callback.perform(refund(new RefundOrder(tradeNo, outTradeNo, refundAmount, totalAmount)));
|
||||
}
|
||||
|
||||
/**
|
||||
* 申请退款接口
|
||||
@@ -276,19 +259,6 @@ public abstract class BasePayService<PC extends PayConfigStorage> implements Pay
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 查询退款
|
||||
*
|
||||
* @param tradeNo 支付平台订单号
|
||||
* @param outTradeNo 商户单号
|
||||
* @param callback 处理器
|
||||
* @param <T> 返回类型
|
||||
* @return 处理过后的类型对象,返回支付方查询退款后的结果
|
||||
*/
|
||||
@Override
|
||||
public <T> T refundquery(String tradeNo, String outTradeNo, Callback<T> callback) {
|
||||
return callback.perform(refundquery(tradeNo, outTradeNo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询退款
|
||||
|
||||
@@ -7,7 +7,6 @@ import com.egzosn.pay.common.http.HttpRequestTemplate;
|
||||
|
||||
import java.awt.image.BufferedImage;
|
||||
import java.io.InputStream;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import java.util.Map;
|
||||
|
||||
@@ -243,35 +242,7 @@ public interface PayService<PC extends PayConfigStorage> {
|
||||
*/
|
||||
<T> T cancel(String tradeNo, String outTradeNo, Callback<T> callback);
|
||||
|
||||
/**
|
||||
* 申请退款接口
|
||||
* 废弃
|
||||
*
|
||||
* @param tradeNo 支付平台订单号
|
||||
* @param outTradeNo 商户单号
|
||||
* @param refundAmount 退款金额
|
||||
* @param totalAmount 总金额
|
||||
* @return 返回支付方申请退款后的结果
|
||||
* @see #refund(RefundOrder)
|
||||
*/
|
||||
@Deprecated
|
||||
Map<String, Object> refund(String tradeNo, String outTradeNo, BigDecimal refundAmount, BigDecimal totalAmount);
|
||||
|
||||
/**
|
||||
* 申请退款接口
|
||||
* 废弃
|
||||
*
|
||||
* @param tradeNo 支付平台订单号
|
||||
* @param outTradeNo 商户单号
|
||||
* @param refundAmount 退款金额
|
||||
* @param totalAmount 总金额
|
||||
* @param callback 处理器
|
||||
* @param <T> 返回类型
|
||||
* @return 返回支付方申请退款后的结果
|
||||
* @see #refund(RefundOrder, Callback)
|
||||
*/
|
||||
@Deprecated
|
||||
<T> T refund(String tradeNo, String outTradeNo, BigDecimal refundAmount, BigDecimal totalAmount, Callback<T> callback);
|
||||
|
||||
/**
|
||||
* 申请退款接口
|
||||
@@ -291,27 +262,7 @@ public interface PayService<PC extends PayConfigStorage> {
|
||||
*/
|
||||
<T> T refund(RefundOrder refundOrder, Callback<T> callback);
|
||||
|
||||
/**
|
||||
* 查询退款
|
||||
*
|
||||
* @param tradeNo 支付平台订单号
|
||||
* @param outTradeNo 商户单号
|
||||
* @return 返回支付方查询退款后的结果
|
||||
*/
|
||||
@Deprecated
|
||||
Map<String, Object> refundquery(String tradeNo, String outTradeNo);
|
||||
|
||||
/**
|
||||
* 查询退款
|
||||
*
|
||||
* @param tradeNo 支付平台订单号
|
||||
* @param outTradeNo 商户单号
|
||||
* @param callback 处理器
|
||||
* @param <T> 返回类型
|
||||
* @return 返回支付方查询退款后的结果
|
||||
*/
|
||||
@Deprecated
|
||||
<T> T refundquery(String tradeNo, String outTradeNo, Callback<T> callback);
|
||||
|
||||
/**
|
||||
* 查询退款
|
||||
|
||||
@@ -371,22 +371,6 @@ public class FuiouPayService extends BasePayService<FuiouPayConfigStorage> {
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 申请退款接口
|
||||
*
|
||||
* @param tradeNo 支付平台订单号
|
||||
* @param outTradeNo 商户单号
|
||||
* @param refundAmount 退款金额
|
||||
* @param totalAmount 总金额
|
||||
* @return 退款返回结果集
|
||||
*/
|
||||
@Override
|
||||
public Map<String, Object> refund (String tradeNo, String outTradeNo, BigDecimal refundAmount, BigDecimal totalAmount) {
|
||||
return refund(new RefundOrder(tradeNo, outTradeNo, refundAmount, totalAmount));
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 申请退款接口
|
||||
@@ -413,20 +397,6 @@ public class FuiouPayService extends BasePayService<FuiouPayConfigStorage> {
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 查询退款
|
||||
* @param tradeNo 支付平台订单号
|
||||
* @param outTradeNo 商户单号
|
||||
* @return 空
|
||||
*
|
||||
*/
|
||||
|
||||
@Override
|
||||
public Map<String, Object> refundquery(String tradeNo, String outTradeNo) {
|
||||
return Collections.emptyMap();
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询退款
|
||||
*
|
||||
|
||||
@@ -18,7 +18,6 @@ import org.apache.http.Header;
|
||||
import org.apache.http.entity.ContentType;
|
||||
import org.apache.http.message.BasicHeader;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
@@ -313,22 +312,7 @@ public class PayoneerPayService extends BasePayService<PayoneerConfigStorage> im
|
||||
return secondaryInterface(tradeNo, outTradeNo, PayoneerTransactionType.CHARGE_CANCEL);
|
||||
}
|
||||
|
||||
/**
|
||||
* 申请退款接口
|
||||
* 废弃
|
||||
*
|
||||
* @param tradeNo 支付平台订单号
|
||||
* @param outTradeNo 商户单号
|
||||
* @param refundAmount 退款金额
|
||||
* @param totalAmount 总金额
|
||||
*
|
||||
* @return 返回支付方申请退款后的结果
|
||||
* @see #refund(RefundOrder)
|
||||
*/
|
||||
@Override
|
||||
public Map<String, Object> refund(String tradeNo, String outTradeNo, BigDecimal refundAmount, BigDecimal totalAmount) {
|
||||
return close(tradeNo, outTradeNo);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
@@ -343,18 +327,6 @@ public class PayoneerPayService extends BasePayService<PayoneerConfigStorage> im
|
||||
return close(refundOrder.getTradeNo(), refundOrder.getOutTradeNo());
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询退款
|
||||
*
|
||||
* @param tradeNo 支付平台订单号
|
||||
* @param outTradeNo 商户单号
|
||||
*
|
||||
* @return 返回支付方查询退款后的结果
|
||||
*/
|
||||
@Override
|
||||
public Map<String, Object> refundquery(String tradeNo, String outTradeNo) {
|
||||
return Collections.emptyMap();
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询退款
|
||||
|
||||
@@ -16,7 +16,7 @@ import com.egzosn.pay.paypal.bean.order.*;
|
||||
import org.apache.http.Header;
|
||||
import org.apache.http.entity.ContentType;
|
||||
import org.apache.http.message.BasicHeader;
|
||||
import java.awt.image.BufferedImage;
|
||||
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.*;
|
||||
@@ -239,22 +239,7 @@ public class PayPalPayService extends BasePayService<PayPalConfigStorage>{
|
||||
public Map<String, Object> close(String tradeNo, String outTradeNo) {
|
||||
return null;
|
||||
}
|
||||
/**
|
||||
* 申请退款接口
|
||||
* 废弃
|
||||
* @param tradeNo 支付平台订单号
|
||||
* @param outTradeNo 商户单号
|
||||
* @param refundAmount 退款金额
|
||||
* @param totalAmount 总金额
|
||||
* @return 返回支付方申请退款后的结果
|
||||
* @see #refund(RefundOrder)
|
||||
* @deprecated {@link #refund(RefundOrder)}
|
||||
*/
|
||||
@Deprecated
|
||||
@Override
|
||||
public Map<String, Object> refund(String tradeNo, String outTradeNo, BigDecimal refundAmount, BigDecimal totalAmount) {
|
||||
return refund(new RefundOrder( tradeNo, outTradeNo, refundAmount, totalAmount));
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
@@ -284,18 +269,6 @@ public class PayPalPayService extends BasePayService<PayPalConfigStorage>{
|
||||
JSONObject resp = getHttpRequestTemplate().postForObject(getReqUrl(PayPalTransactionType.REFUND), httpEntity, JSONObject.class, refundOrder.getTradeNo());
|
||||
return resp;
|
||||
}
|
||||
/**
|
||||
* 查询退款
|
||||
*
|
||||
* @param tradeNo 支付平台订单号
|
||||
* @param outTradeNo 商户单号
|
||||
* @return 返回支付方查询退款后的结果
|
||||
*/
|
||||
@Override
|
||||
public Map<String, Object> refundquery(String tradeNo, String outTradeNo) {
|
||||
JSONObject resp = getHttpRequestTemplate().getForObject(getReqUrl(PayPalTransactionType.REFUND_QUERY), authHeader(), JSONObject.class, tradeNo);
|
||||
return resp;
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询退款
|
||||
@@ -305,7 +278,8 @@ public class PayPalPayService extends BasePayService<PayPalConfigStorage>{
|
||||
*/
|
||||
@Override
|
||||
public Map<String, Object> refundquery(RefundOrder refundOrder) {
|
||||
return refundquery(refundOrder.getTradeNo(), refundOrder.getOutTradeNo());
|
||||
JSONObject resp = getHttpRequestTemplate().getForObject(getReqUrl(PayPalTransactionType.REFUND_QUERY), authHeader(), JSONObject.class, refundOrder.getTradeNo());
|
||||
return resp;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -9,7 +9,6 @@ import com.egzosn.pay.common.exception.PayErrorException;
|
||||
import com.egzosn.pay.common.http.HttpConfigStorage;
|
||||
import com.egzosn.pay.common.http.UriVariables;
|
||||
import com.egzosn.pay.common.util.DateUtils;
|
||||
import com.egzosn.pay.common.util.MatrixToImageWriter;
|
||||
import com.egzosn.pay.common.util.Util;
|
||||
import com.egzosn.pay.common.util.sign.CertDescriptor;
|
||||
import com.egzosn.pay.common.util.sign.SignUtils;
|
||||
@@ -609,40 +608,12 @@ public class UnionPayService extends BasePayService<UnionPayConfigStorage> {
|
||||
return Collections.emptyMap();
|
||||
}
|
||||
|
||||
/**
|
||||
* 申请退款接口
|
||||
*
|
||||
* @param tradeNo 支付平台订单号
|
||||
* @param outTradeNo 商户单号
|
||||
* @param refundAmount 退款金额
|
||||
* @param totalAmount 总金额
|
||||
* @return 返回支付方申请退款后的结果
|
||||
* @see #refund(RefundOrder)
|
||||
*/
|
||||
@Deprecated
|
||||
@Override
|
||||
public Map<String, Object> refund(String tradeNo, String outTradeNo, BigDecimal refundAmount, BigDecimal totalAmount) {
|
||||
return refund(new RefundOrder(tradeNo, outTradeNo, refundAmount, totalAmount));
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public Map<String, Object> refund(RefundOrder refundOrder) {
|
||||
return unionRefundOrConsumeUndo(refundOrder, UnionTransactionType.REFUND);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询退款
|
||||
*
|
||||
* @param tradeNo 支付平台订单号
|
||||
* @param outTradeNo 商户单号
|
||||
* @return 返回支付方查询退款后的结果
|
||||
*/
|
||||
@Override
|
||||
public Map<String, Object> refundquery(String tradeNo, String outTradeNo) {
|
||||
return Collections.emptyMap();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 查询退款
|
||||
|
||||
@@ -385,13 +385,14 @@ public class WxYouDianPayService extends BasePayService<WxYouDianPayConfigStorag
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public Map<String, Object> refund(String tradeNo, String outTradeNo, BigDecimal refundAmount, BigDecimal totalAmount) {
|
||||
return refund(new RefundOrder(tradeNo, outTradeNo,refundAmount, totalAmount));
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 申请退款接口
|
||||
*
|
||||
* @param refundOrder 退款订单信息
|
||||
* @return 返回支付方申请退款后的结果
|
||||
*/
|
||||
@Override
|
||||
public Map<String, Object> refund(RefundOrder refundOrder) {
|
||||
String apbNonce = SignUtils.randomStr();
|
||||
@@ -413,11 +414,6 @@ public class WxYouDianPayService extends BasePayService<WxYouDianPayConfigStorag
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public Map<String, Object> refundquery(String tradeNo, String outTradeNo) {
|
||||
return Collections.emptyMap();
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询退款
|
||||
*
|
||||
|
||||
@@ -10,7 +10,7 @@ import com.egzosn.pay.common.util.Util;
|
||||
import com.egzosn.pay.common.util.sign.SignUtils;
|
||||
import com.egzosn.pay.common.util.str.StringUtils;
|
||||
import com.egzosn.pay.yiji.bean.YiJiTransactionType;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.Date;
|
||||
import java.util.Map;
|
||||
@@ -292,24 +292,6 @@ public class YiJiPayService extends BasePayService<YiJiPayConfigStorage> {
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 申请退款接口
|
||||
* 废弃
|
||||
*
|
||||
* @param tradeNo 支付平台订单号
|
||||
* @param outTradeNo 商户单号
|
||||
* @param refundAmount 退款金额
|
||||
* @param totalAmount 总金额
|
||||
* @return 返回支付方申请退款后的结果
|
||||
* @see #refund(RefundOrder, com.egzosn.pay.common.api.Callback)
|
||||
* @deprecated 版本替代 {@link #refund(RefundOrder, com.egzosn.pay.common.api.Callback)}
|
||||
*/
|
||||
@Deprecated
|
||||
@Override
|
||||
public Map<String, Object> refund(String tradeNo, String outTradeNo, BigDecimal refundAmount, BigDecimal totalAmount) {
|
||||
return refund(new RefundOrder(tradeNo, outTradeNo, refundAmount, totalAmount));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 申请退款接口
|
||||
@@ -329,18 +311,6 @@ public class YiJiPayService extends BasePayService<YiJiPayConfigStorage> {
|
||||
return getHttpRequestTemplate().postForObject(getReqUrl(YiJiTransactionType.tradeRefund), orderInfo, JSONObject.class);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询退款
|
||||
*
|
||||
* @param tradeNo 支付平台订单号
|
||||
* @param outTradeNo 商户单号
|
||||
* @return 返回支付方查询退款后的结果
|
||||
*/
|
||||
@Override
|
||||
public Map<String, Object> refundquery(String tradeNo, String outTradeNo) {
|
||||
return Collections.emptyMap();
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询退款
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user