mirror of
https://gitee.com/egzosn/pay-java-parent.git
synced 2026-05-23 10:31:52 +08:00
新增toPay方法,以便于简化跳转支付;对支付对接地址抽象出接口方法
This commit is contained in:
@@ -122,6 +122,18 @@ public abstract class BasePayService<PC extends PayConfigStorage> implements Pay
|
||||
return SignUtils.valueOf(payConfigStorage.getSignType()).sign(content, payConfigStorage.getKeyPrivate(),characterEncoding);
|
||||
}
|
||||
|
||||
/**
|
||||
* 页面转跳支付, 返回对应页面重定向信息
|
||||
*
|
||||
* @param order 订单信息
|
||||
* @return 对应页面重定向信息
|
||||
*/
|
||||
@Override
|
||||
public String toPay(PayOrder order) {
|
||||
Map orderInfo = orderInfo(order);
|
||||
return buildRequest(orderInfo, MethodType.POST);
|
||||
}
|
||||
|
||||
/**
|
||||
* 将请求参数或者请求流转化为 Map
|
||||
*
|
||||
|
||||
@@ -87,6 +87,12 @@ public interface PayService<PC extends PayConfigStorage> {
|
||||
*/
|
||||
Map<String, Object> orderInfo(PayOrder order);
|
||||
|
||||
/**
|
||||
* 页面转跳支付, 返回对应页面重定向信息
|
||||
* @param order 订单信息
|
||||
* @return 对应页面重定向信息
|
||||
*/
|
||||
String toPay(PayOrder order);
|
||||
/**
|
||||
* 创建签名
|
||||
*
|
||||
@@ -141,6 +147,8 @@ public interface PayService<PC extends PayConfigStorage> {
|
||||
*/
|
||||
String buildRequest(Map<String, Object> orderInfo, MethodType method);
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 获取输出二维码,用户返回给支付端,
|
||||
*
|
||||
@@ -410,4 +418,11 @@ public interface PayService<PC extends PayConfigStorage> {
|
||||
*/
|
||||
void addPayMessageInterceptor(PayMessageInterceptor interceptor);
|
||||
|
||||
/**
|
||||
* 获取支付请求地址
|
||||
* @param transactionType 交易类型
|
||||
* @return 请求地址
|
||||
*/
|
||||
String getReqUrl(TransactionType transactionType);
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user