Переглянути джерело

本地测试环境,支付订单加上标识

plf 4 роки тому
батько
коміт
814f0584f9

+ 14 - 2
pay/src/main/java/com/caimei/module/pay/service/impl/PayServiceImpl.java

@@ -149,8 +149,14 @@ public class PayServiceImpl implements PayService {
             // 时间戳
             long time = System.currentTimeMillis() / 1000;
             JSONObject json = getPayParameter(payment, request, time);
+            String environment = "";
+            if (payment.getNotifyUrl().contains("8008")) {
+                environment = "DEV";
+            } else if (payment.getNotifyUrl().contains("spi-b")) {
+                environment = "BETA";
+            }
             // 商户订单号
-            String orderId = order.getOrderNo() + "T" + time;
+            String orderId = order.getOrderNo() + "T" + time + environment;
             json.put("orderId", orderId);
             //商品名称
             String product = "采美订单" + order.getOrderNo();
@@ -712,8 +718,14 @@ public class PayServiceImpl implements PayService {
             // 时间戳
             long time = System.currentTimeMillis() / 1000;
             JSONObject json = getPayParameter(payment, request, time);
+            String environment = "";
+            if (payment.getNotifyUrl().contains("8008")) {
+                environment = "DEV";
+            } else if (payment.getNotifyUrl().contains("spi-b")) {
+                environment = "BETA";
+            }
             // 商户订单号
-            String orderId = payment.getProductId() + "T" + time;
+            String orderId = payment.getProductId() + "T" + time + environment;
             json.put("orderId", orderId);
             //商品名称
             String product = "采美订单" + orderId;