Browse Source

Merge remote-tracking branch 'origin/dev-mysql' into dev-mysql

wangdy 8 years ago
parent
commit
adc25a1bb2

+ 14 - 0
src/main/java/com/uas/platform/b2c/core/config/SysConf.java

@@ -94,6 +94,12 @@ public class SysConf {
 	@Value("#{sys.storeid}")
 	private String storeid;
 
+	/**
+	 * 银盛支付接口地址
+	 */
+	@Value("#{sys.yes_gateway}")
+	private String yesGateway;
+
 	/**
 	 * 银盛支付后台通知地址
 	 */
@@ -319,4 +325,12 @@ public class SysConf {
 	public void setMessageServiceIp(String messageServiceIp) {
 		this.messageServiceIp = messageServiceIp;
 	}
+
+	public String getYesGateway() {
+		return yesGateway;
+	}
+
+	public void setYesGateway(String yesGateway) {
+		this.yesGateway = yesGateway;
+	}
 }

+ 1 - 1
src/main/java/com/uas/platform/b2c/core/constant/EncodingRulesConstant.java

@@ -136,7 +136,7 @@ public class EncodingRulesConstant {
 	/**
 	 * 交易流水号 YS + 8位时间戳 + 8位编码
 	 */
-	public static final String YSEPAY = "YS_TIMESTAP_NUMBER";
+	public static final String YSEPAY = "TIMESTAP_NUMBER";
 
 	/**
 	 * 爬虫任务表CCT + 8 位时间戳 + 8 位编码

+ 11 - 5
src/main/java/com/uas/platform/b2c/fa/payment/service/impl/PaymentServiceImpl.java

@@ -1,6 +1,7 @@
 package com.uas.platform.b2c.fa.payment.service.impl;
 
 import com.uas.platform.b2c.core.config.SysConf;
+import com.uas.platform.b2c.core.constant.EncodingRulesConstant;
 import com.uas.platform.b2c.core.support.SystemSession;
 import com.uas.platform.b2c.core.utils.FastjsonUtils;
 import com.uas.platform.b2c.core.utils.NumberUtil;
@@ -19,7 +20,6 @@ import com.uas.platform.b2c.trade.order.dao.OrderDao;
 import com.uas.platform.b2c.trade.order.model.Order;
 import com.uas.platform.b2c.trade.order.service.OrderService;
 import com.uas.platform.core.exception.IllegalOperatorException;
-import com.uas.platform.core.model.EncodingRulesConstant;
 import com.uas.platform.core.model.PageInfo;
 import com.uas.platform.core.model.Status;
 import com.uas.platform.core.model.Type;
@@ -111,12 +111,12 @@ public class PaymentServiceImpl implements PaymentService {
 			set.add(paymentDetail);
 		}
 		String paymentid = null;
-		String numberUtil = EncodingRulesConstant.YSEPAY.replace("_TIMESTAP_NUMBER",
-				createNumberService.getTimeNumber("trade$payment", 8));
+		String numberUtil = EncodingRulesConstant.YSEPAY.replace("TIMESTAP_NUMBER",
+				createNumberService.getTimeNumber("trade$payment", 7));
 		Map<String, String> map = new HashMap<String, String>();
 		String referer = request.getHeader("Referer");
 		if("test".equals(sysConf.getPaymentPrice())){
-			paymentid = numberUtil + "test";
+			paymentid = numberUtil + "t";
 			StringBuilder buffer = new StringBuilder();
 			String returnUrl = null;
 			if(StringUtils.isEmpty(basePath)) {
@@ -127,7 +127,7 @@ public class PaymentServiceImpl implements PaymentService {
 			map.put("return_url", returnUrl);
 		}
 		if("prod".equals(sysConf.getPaymentPrice())){
-			paymentid = numberUtil + "prod";
+			paymentid = numberUtil + "p";
 			map.put("return_url", sysConf.getReturnUrl());
 		}
 		payment.setPaymentid(paymentid);
@@ -146,6 +146,8 @@ public class PaymentServiceImpl implements PaymentService {
 		SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
 		String timestamp = sdf.format(new Date());
 
+
+
 		// 待签名参数
 		map.put("out_trade_no", paymentid);
 		map.put("subject", subject);
@@ -165,6 +167,10 @@ public class PaymentServiceImpl implements PaymentService {
 		// 生成付款请求参数map(加上签名)
 		Map<String, String> sPara = ApipaySubmit.buildRequestPara(request, map);
 
+		// 银盛接口链接
+		String yesGateway = sysConf.getYesGateway();
+		sPara.put("action", yesGateway);
+
 		return sPara;
 	}
 

+ 4 - 1
src/main/resources/dev/sys.properties

@@ -14,8 +14,11 @@ adminUU=1000001962
 adminName=\u5218\u840C\u51B0
 enName=\u4F18\u8F6F\u6D4B\u8BD5\u4E8C
 storeid = 33069557578d44e69bd91ad12d28a8d4
+
+# YesPay config
+yes_gateway=https://mertest.ysepay.com/openapi_gateway/gateway.do
 notifyURL=http://218.17.158.219:9090/platform-b2c/api/payment/ysepayNotify
-returnUrl =/api/yesreturn
+returnUrl=/api/yesreturn
 paymentPrice=test
 orderProxyUrl=http://192.168.253.12:23400/order/proxy
 #report url

+ 3 - 0
src/main/resources/prod/sys.properties

@@ -15,6 +15,9 @@ adminUU=1000002821
 adminName=\u5218\u840C\u51B0
 storeid = 33069557578d44e69bd91ad12d28a8d4
 enName=\u6DF1\u5733\u5E02\u4F18\u8F6F\u5546\u57CE\u79D1\u6280\u6709\u9650\u516C\u53F8
+
+# YesPay config
+yes_gateway=https://openapi.ysepay.com/gateway.do
 notifyURL=http://www.usoftmall.com/api/payment/ysepayNotify
 returnUrl=http://www.usoftmall.com/api/yesreturn
 paymentPrice=prod

+ 3 - 0
src/main/resources/test/sys.properties

@@ -14,6 +14,9 @@ adminUU=1000001962
 storeid = 33069557578d44e69bd91ad12d28a8d4
 adminName=\u5218\u840C\u51B0
 enName=\u4F18\u8F6F\u6D4B\u8BD5\u4E8C
+
+# YesPay config
+yes_gateway=https://mertest.ysepay.com/openapi_gateway/gateway.do
 notifyURL=http://218.17.158.219:9090/platform-b2c/api/payment/ysepayNotify
 returnUrl=/api/yesreturn
 paymentPrice=test

+ 1 - 1
src/main/webapp/resources/js/usercenter/controllers/forstore/order_pay_ctrl.js

@@ -629,7 +629,7 @@ define(['app/app'], function(app) {
 				$scope.ysepayRequest = data;
 				$scope.$apply();
 				var form = document.getElementById('paymentForm');
-				form.action = "https://openapi.ysepay.com/gateway.do";
+				form.action = data.action;
 				form.method = "POST";
 				var submit = form.submit();
 			},function(res){