mirror of
https://gitee.com/egzosn/pay-java-parent.git
synced 2026-05-07 19:46:15 +08:00
新增订单有效时间
This commit is contained in:
@@ -200,8 +200,9 @@ public class AliPayService extends BasePayService {
|
||||
bizContent.put("product_code", "QUICK_MSECURITY_PAY");
|
||||
}
|
||||
}
|
||||
//TODO 过期时间
|
||||
// bizContent.put("timeout_express", )
|
||||
if (null != order.getExpirationTime()){
|
||||
bizContent.put("timeout_express", ((order.getExpirationTime().getTime() - System.currentTimeMillis())/1000/60 + "m"));
|
||||
}
|
||||
orderInfo.put("biz_content", JSON.toJSONString(bizContent));
|
||||
return orderInfo;
|
||||
}
|
||||
|
||||
@@ -38,7 +38,10 @@ public class AliPayService extends BasePayService {
|
||||
|
||||
private static final String HTTPS_REQ_URL = "https://mapi.alipay.com/gateway.do";
|
||||
private static final String QUERY_REQ_URL = "https://openapi.alipay.com/gateway.do";
|
||||
|
||||
DateFormat df = new SimpleDateFormat("yyyy-MM-dd");
|
||||
{
|
||||
df.setTimeZone(TimeZone.getTimeZone("GMT+8"));
|
||||
}
|
||||
public AliPayService(PayConfigStorage payConfigStorage) {
|
||||
super(payConfigStorage);
|
||||
}
|
||||
@@ -428,8 +431,7 @@ public class AliPayService extends BasePayService {
|
||||
Map<String, Object> bizContent = new TreeMap<>();
|
||||
bizContent.put("bill_type", billType);
|
||||
//目前只支持日账单
|
||||
DateFormat df = new SimpleDateFormat("yyyy-MM-dd");
|
||||
df.setTimeZone(TimeZone.getTimeZone("GMT+8"));
|
||||
|
||||
bizContent.put("bill_date", df.format(billDate));
|
||||
//设置请求参数的集合
|
||||
parameters.put("biz_content", JSON.toJSONString(bizContent));
|
||||
|
||||
@@ -55,7 +55,10 @@ public class UnionPayService extends BasePayService {
|
||||
private static final String FILE_TRANS_URL= "https://filedownload.%s/";
|
||||
private static final String APP_TRANS_URL= "https://gateway.%s/gateway/api/appTransReq.do";
|
||||
private static final String CARD_TRANS_URL= "https://gateway.%s/gateway/api/cardTransReq.do";
|
||||
|
||||
public final static DateFormat df = new SimpleDateFormat("yyyyMMddHHmmss");
|
||||
{
|
||||
df.setTimeZone(TimeZone.getTimeZone("GMT+8"));
|
||||
}
|
||||
|
||||
/**
|
||||
* 构造函数
|
||||
@@ -207,12 +210,15 @@ public class UnionPayService extends BasePayService {
|
||||
case B2B:
|
||||
params.put(SDKConstants.param_txnAmt, order.getPrice().multiply(new BigDecimal(100)));
|
||||
params.put("orderDesc", order.getSubject());
|
||||
DateFormat df = new SimpleDateFormat("yyyyMMddHHmmss");
|
||||
// 订单超时时间。
|
||||
// 超过此时间后,除网银交易外,其他交易银联系统会拒绝受理,提示超时。 跳转银行网银交易如果超时后交易成功,会自动退款,大约5个工作日金额返还到持卡人账户。
|
||||
// 此时间建议取支付时的北京时间加15分钟。
|
||||
// 超过超时时间调查询接口应答origRespCode不是A6或者00的就可以判断为失败。
|
||||
params.put(SDKConstants.param_payTimeout, df.format(System.currentTimeMillis() + 30 * 60 * 1000));
|
||||
if (null != order.getExpirationTime()){
|
||||
params.put(SDKConstants.param_payTimeout, order.getExpirationTime());
|
||||
}else {
|
||||
params.put(SDKConstants.param_payTimeout, df.format(System.currentTimeMillis() + 30 * 60 * 1000));
|
||||
}
|
||||
params.put(SDKConstants.param_frontUrl, payConfigStorage.getReturnUrl());
|
||||
break;
|
||||
case CONSUME:
|
||||
|
||||
@@ -56,7 +56,7 @@ public class WxPayService extends BasePayService {
|
||||
public final static String FAILURE = "failure";
|
||||
public final static String APPID = "appid";
|
||||
private final static DateFormat downloadbillDf = new SimpleDateFormat("yyyyMMdd");
|
||||
public final static DateFormat df = new SimpleDateFormat("yyyyMMddHHmms");
|
||||
private final static DateFormat df = new SimpleDateFormat("yyyyMMddHHmms");
|
||||
|
||||
{
|
||||
TimeZone timeZone = TimeZone.getTimeZone("GMT+8");
|
||||
|
||||
Reference in New Issue
Block a user