瀏覽代碼

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

plf 4 年之前
父節點
當前提交
814f0584f9
共有 1 個文件被更改,包括 14 次插入2 次删除
  1. 14 2
      pay/src/main/java/com/caimei/module/pay/service/impl/PayServiceImpl.java

+ 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;