新增订单有效时间

This commit is contained in:
egan
2018-08-04 22:51:46 +08:00
parent 81b44146ff
commit cb792db07e
4 changed files with 18 additions and 9 deletions

View File

@@ -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;
}

View File

@@ -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));