forked from shuzheng/zheng
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
58 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
42 changes: 42 additions & 0 deletions
42
zheng-pay/zheng-pay-web/src/main/java/com/zheng/pay/web/controller/AlipayController.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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(); | ||
} | ||
|
||
} |
8 changes: 0 additions & 8 deletions
8
zheng-pay/zheng-pay-web/src/main/java/com/zheng/pay/web/controller/AppController.java
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 10 additions & 8 deletions
18
zheng-pay/zheng-pay-web/src/main/resources/config.properties
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
11 changes: 1 addition & 10 deletions
11
zheng-pay/zheng-pay-web/src/main/resources/profiles/dev.properties
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |