|
|
@@ -119,8 +119,17 @@ public class SandPayService {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- public JSONObject requestAlipay(String orderId, BigDecimal amount, String subject, String desc,
|
|
|
- int timeout, String extend) {
|
|
|
+ public String requestAlipay(String orderId, BigDecimal amount, String subject, String desc,
|
|
|
+ int timeout, String extend) {
|
|
|
+ JSONObject res = requestAlipayRaw(orderId, amount, subject, desc, timeout, extend);
|
|
|
+ if ("000000".equals(res.getJSONObject("head").getString("respCode"))) {
|
|
|
+ return "alipays://platformapi/startapp?saId=10000007&qrcode=" + res.getJSONObject("body").getString("qrCode");
|
|
|
+ }
|
|
|
+ throw new BusinessException("绿洲宇宙冷却系统已启动,请稍后支付");
|
|
|
+ }
|
|
|
+
|
|
|
+ public JSONObject requestAlipayRaw(String orderId, BigDecimal amount, String subject, String desc,
|
|
|
+ int timeout, String extend) {
|
|
|
if (orderId.length() < 12) {
|
|
|
for (int i = orderId.length(); i < 12; i++) {
|
|
|
orderId = "0" + orderId;
|
|
|
@@ -142,7 +151,7 @@ public class SandPayService {
|
|
|
//body.put("limitPay", "5"); //限定支付方式 送1-限定不能使用贷记卡 送4-限定不能使用花呗 送5-限定不能使用贷记卡+花呗
|
|
|
body.put("subject", subject); //订单标题
|
|
|
body.put("body", desc); //订单描述
|
|
|
- body.put("txnTimeOut", getTimeout(timeout)); //订单超时时间
|
|
|
+ body.put("txnTimeOut", getTimeout(timeout)); //订单超时时间
|
|
|
body.put("notifyUrl", sandPayProperties.getNotifyUrl()); //异步通知地址
|
|
|
body.put("bizExtendParams", ""); //业务扩展参数
|
|
|
body.put("merchExtendParams", ""); //商户扩展参数
|
|
|
@@ -239,7 +248,7 @@ public class SandPayService {
|
|
|
extend.put("type", "order");
|
|
|
extend.put("id", orderId);
|
|
|
|
|
|
- JSONObject res = requestAlipay(orderId.toString(), order.getTotalPrice(), order.getName(), order.getName(),
|
|
|
+ JSONObject res = requestAlipayRaw(orderId.toString(), order.getTotalPrice(), order.getName(), order.getName(),
|
|
|
180, extend.toJSONString());
|
|
|
if (res == null)
|
|
|
throw new BusinessException("下单失败,请稍后再试");
|
|
|
@@ -296,7 +305,7 @@ public class SandPayService {
|
|
|
extend.put("type", "gift");
|
|
|
extend.put("id", orderId);
|
|
|
|
|
|
- JSONObject res = requestAlipay(orderId.toString(), order.getGasPrice(), "转增" + order.getAssetId(), "转增" + order.getAssetId(),
|
|
|
+ JSONObject res = requestAlipayRaw(orderId.toString(), order.getGasPrice(), "转增" + order.getAssetId(), "转增" + order.getAssetId(),
|
|
|
180, extend.toJSONString());
|
|
|
if (res == null)
|
|
|
throw new BusinessException("下单失败,请稍后再试");
|
|
|
@@ -325,7 +334,7 @@ public class SandPayService {
|
|
|
extend.put("type", "mintOrder");
|
|
|
extend.put("id", orderId);
|
|
|
|
|
|
- JSONObject res = requestAlipay(orderId.toString(), order.getGasPrice(), "铸造活动:" + order.getMintActivityId(),
|
|
|
+ JSONObject res = requestAlipayRaw(orderId.toString(), order.getGasPrice(), "铸造活动:" + order.getMintActivityId(),
|
|
|
"铸造活动:" + order.getMintActivityId(), 180, extend.toJSONString());
|
|
|
if (res == null)
|
|
|
throw new BusinessException("下单失败,请稍后再试");
|