From 0b3806bfb8a13a41623e65ce90b5f97c7b04433d Mon Sep 17 00:00:00 2001
From: shuzheng <469741414@qq.com>
Date: Tue, 4 Apr 2017 01:06:28 +0800
Subject: [PATCH] =?UTF-8?q?=E5=AE=8C=E6=88=90=E6=94=AF=E4=BB=98=E5=AE=9D?=
=?UTF-8?q?=E6=89=8B=E6=9C=BA=E7=BD=91=E7=AB=99=E6=94=AF=E4=BB=98=E6=8E=A5?=
=?UTF-8?q?=E5=85=A5?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
zheng-pay/zheng-pay-web/pom.xml | 6 ---
.../pay/web/controller/AlipayController.java | 42 +++++++++++++++++++
.../pay/web/controller/AppController.java | 8 ----
.../resources/applicationContext-alipay.xml | 6 ++-
.../src/main/resources/config.properties | 18 ++++----
.../main/resources/profiles/dev.properties | 11 +----
6 files changed, 58 insertions(+), 33 deletions(-)
create mode 100644 zheng-pay/zheng-pay-web/src/main/java/com/zheng/pay/web/controller/AlipayController.java
delete mode 100644 zheng-pay/zheng-pay-web/src/main/java/com/zheng/pay/web/controller/AppController.java
diff --git a/zheng-pay/zheng-pay-web/pom.xml b/zheng-pay/zheng-pay-web/pom.xml
index 54a1fe63..dcf96e0c 100644
--- a/zheng-pay/zheng-pay-web/pom.xml
+++ b/zheng-pay/zheng-pay-web/pom.xml
@@ -44,12 +44,6 @@
jstl
1.2
-
-
- com.zheng
- zheng-upms-client
- 1.0.0
-
diff --git a/zheng-pay/zheng-pay-web/src/main/java/com/zheng/pay/web/controller/AlipayController.java b/zheng-pay/zheng-pay-web/src/main/java/com/zheng/pay/web/controller/AlipayController.java
new file mode 100644
index 00000000..5bb190a5
--- /dev/null
+++ b/zheng-pay/zheng-pay-web/src/main/java/com/zheng/pay/web/controller/AlipayController.java
@@ -0,0 +1,42 @@
+package com.zheng.pay.web.controller;
+
+
+import com.alibaba.fastjson.JSONObject;
+import com.alipay.api.AlipayClient;
+import com.alipay.api.request.AlipayTradeWapPayRequest;
+import com.zheng.common.base.BaseController;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Controller;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.ResponseBody;
+
+import javax.servlet.http.HttpServletResponse;
+
+/**
+ * 支付宝
+ * Created by ZhangShuzheng on 2017/04/04.
+ */
+@Controller
+@RequestMapping("/alipay")
+public class AlipayController extends BaseController {
+
+ @Autowired
+ private AlipayClient alipayClient;
+
+ @Autowired
+ private AlipayTradeWapPayRequest alipayRequest;
+
+ @RequestMapping("/pay")
+ @ResponseBody
+ public Object pay(HttpServletResponse response) throws Exception {
+ JSONObject bizContent = new JSONObject();
+ bizContent.put("out_trade_no", "pay20170404005030000000");
+ bizContent.put("total_amount", "0.01");
+ bizContent.put("subject", "Iphone6 16G");
+ bizContent.put("seller_id", "2088123456789012");
+ bizContent.put("product_code", "QUICK_WAP_PAY");
+ alipayRequest.setBizContent(bizContent.toString());
+ return alipayClient.pageExecute(alipayRequest).getBody();
+ }
+
+}
\ No newline at end of file
diff --git a/zheng-pay/zheng-pay-web/src/main/java/com/zheng/pay/web/controller/AppController.java b/zheng-pay/zheng-pay-web/src/main/java/com/zheng/pay/web/controller/AppController.java
deleted file mode 100644
index c2332d49..00000000
--- a/zheng-pay/zheng-pay-web/src/main/java/com/zheng/pay/web/controller/AppController.java
+++ /dev/null
@@ -1,8 +0,0 @@
-package com.zheng.pay.web.controller;
-
-
-public class AppController {
-
-
-
-}
\ No newline at end of file
diff --git a/zheng-pay/zheng-pay-web/src/main/resources/applicationContext-alipay.xml b/zheng-pay/zheng-pay-web/src/main/resources/applicationContext-alipay.xml
index 7b42bace..0e85cbb9 100644
--- a/zheng-pay/zheng-pay-web/src/main/resources/applicationContext-alipay.xml
+++ b/zheng-pay/zheng-pay-web/src/main/resources/applicationContext-alipay.xml
@@ -8,7 +8,7 @@
-
+
@@ -17,5 +17,9 @@
+
+
+
+
\ No newline at end of file
diff --git a/zheng-pay/zheng-pay-web/src/main/resources/config.properties b/zheng-pay/zheng-pay-web/src/main/resources/config.properties
index 1c3a7230..dc3b0c56 100644
--- a/zheng-pay/zheng-pay-web/src/main/resources/config.properties
+++ b/zheng-pay/zheng-pay-web/src/main/resources/config.properties
@@ -1,10 +1,12 @@
env=${profile.env}
-alipay.appid=${alipay.appid}
-alipay.gateway=${alipay.gateway}
-alipay.rsa.private_key=${alipay.rsa.private_key}
-alipay.rsa.public_key=${alipay.rsa.public_key}
-alipay.alipay_public_key=${alipay.alipay_public_key}
-alipay.format=${alipay.format}
-alipay.charset=${alipay.charset}
-alipay.sign_type=${alipay.sign_type}
+alipay.appid=
+alipay.gateway=https://openapi.alipaydev.com/gateway.do
+alipay.rsa.private_key=
+alipay.rsa.public_key=
+alipay.alipay_public_key=
+alipay.format=json
+alipay.charset=UTF-8
+alipay.sign_type=RSA2
+alipay.returnUrl=http://pay.zhangshuzheng.cn/alipay/returnUrl
+alipay.notifyUrl=http://pay.zhangshuzheng.cn/alipay/notifyUrl
diff --git a/zheng-pay/zheng-pay-web/src/main/resources/profiles/dev.properties b/zheng-pay/zheng-pay-web/src/main/resources/profiles/dev.properties
index 8924ed9d..baede636 100644
--- a/zheng-pay/zheng-pay-web/src/main/resources/profiles/dev.properties
+++ b/zheng-pay/zheng-pay-web/src/main/resources/profiles/dev.properties
@@ -1,10 +1 @@
-profile.env=dev
-
-alipay.appid=
-alipay.gateway=https://openapi.alipaydev.com/gateway.do
-alipay.rsa.private_key=
-alipay.rsa.public_key=
-alipay.alipay_public_key=
-alipay.format=json
-alipay.charset=UTF-8
-alipay.sign_type=RSA2
+profile.env=dev
\ No newline at end of file