Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
caosy
/
fun-common
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
2
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
4ae5db56
authored
Sep 06, 2018
by
chongli
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'miniAppPay' into f-6.6.9
parents
d709aaa4
98e14718
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
98 additions
and
1 deletions
fun-common-soa/src/main/java/com/ctrip/fun/golf/api/payment/NotifyController.java
fun-common-soa/src/main/java/com/ctrip/fun/golf/service/payment/NotifyService.java
fun-common-vo/src/main/java/com/ctrip/fun/common/vo/basic/VoucherItemDTO.java
fun-common-vo/src/main/java/com/ctrip/fun/common/vo/order/AbstractOrderBean.java
fun-common-vo/src/main/java/com/ctrip/fun/common/vo/order/OrderCategoryEnum.java
fun-common-soa/src/main/java/com/ctrip/fun/golf/api/payment/NotifyController.java
View file @
4ae5db56
...
...
@@ -43,6 +43,32 @@ public class NotifyController {
return
notifyResponseBean
;
}
/**
* 微信支付通知
*/
@RequestMapping
(
value
=
"/{orderType}/notifyForWeiXinPay"
,
produces
=
"application/json;charset=UTF-8"
)
@ResponseBody
public
String
notifyForWeiXinPay
(
HttpServletRequest
request
,
HttpServletResponse
response
,
@PathVariable
String
orderType
)
throws
Exception
{
BufferedReader
reader
=
null
;
reader
=
request
.
getReader
();
String
line
=
""
;
String
xmlString
=
null
;
StringBuffer
inputString
=
new
StringBuffer
();
while
((
line
=
reader
.
readLine
())
!=
null
)
{
inputString
.
append
(
line
);
}
xmlString
=
inputString
.
toString
();
request
.
getReader
().
close
();
System
.
out
.
println
(
"----接收到的数据如下:---"
+
xmlString
);
this
.
notifyService
.
notifyForWeiXinPay
(
orderType
,
xmlString
);
response
.
getWriter
().
write
(
"<xml><return_code><![CDATA[SUCCESS]]></return_code></xml>"
);
return
null
;
}
/**
* 微信支付通知
*/
...
...
@@ -66,6 +92,29 @@ public class NotifyController {
return
null
;
}
/**
* 微信支付通知
*/
@RequestMapping
(
value
=
"/notifyForVoucherMiniApp"
,
produces
=
"application/json;charset=UTF-8"
)
@ResponseBody
public
String
notifyForVoucherMiniApp
(
HttpServletRequest
request
,
HttpServletResponse
response
)
throws
Exception
{
BufferedReader
reader
=
null
;
reader
=
request
.
getReader
();
String
line
=
""
;
String
xmlString
=
null
;
StringBuffer
inputString
=
new
StringBuffer
();
while
((
line
=
reader
.
readLine
())
!=
null
)
{
inputString
.
append
(
line
);
}
xmlString
=
inputString
.
toString
();
request
.
getReader
().
close
();
System
.
out
.
println
(
"----接收到的数据如下:---"
+
xmlString
);
this
.
notifyService
.
notifyForVoucherMiniApp
(
xmlString
);
response
.
getWriter
().
write
(
"<xml><return_code><![CDATA[SUCCESS]]></return_code></xml>"
);
return
null
;
}
public
NotifyService
getNotifyService
()
{
return
notifyService
;
...
...
fun-common-soa/src/main/java/com/ctrip/fun/golf/service/payment/NotifyService.java
View file @
4ae5db56
...
...
@@ -42,12 +42,35 @@ public class NotifyService {
* @param paymentResponse
* @return
*/
public
String
notifyForWeiXinPay
(
String
orderType
,
String
xml
)
{
HttpEntity
<
String
>
entity
=
new
HttpEntity
<
String
>(
xml
);
String
response
=
restTemplate
.
exchange
(
this
.
getServerBaseNotifyPath
()+
"/"
+
orderType
+
"/notifyForWeiXinPay"
,
HttpMethod
.
POST
,
entity
,
new
ParameterizedTypeReference
<
String
>()
{
}).
getBody
();
return
null
;
}
/**
* @param paymentResponse
* @return
*/
public
String
notifyForMiniApp
(
String
xml
)
{
HttpEntity
<
String
>
entity
=
new
HttpEntity
<
String
>(
xml
);
String
response
=
restTemplate
.
exchange
(
this
.
getServerBaseNotifyPath
()+
"/communeOrder/notifyForMiniApp"
,
HttpMethod
.
POST
,
entity
,
new
ParameterizedTypeReference
<
String
>()
{
}).
getBody
();
return
response
;
}
/**
* @param paymentResponse
* @return
*/
public
String
notifyForVoucherMiniApp
(
String
xml
)
{
HttpEntity
<
String
>
entity
=
new
HttpEntity
<
String
>(
xml
);
String
response
=
restTemplate
.
exchange
(
this
.
getServerBaseNotifyPath
()+
"/communeOrder/notifyForVoucherMiniApp"
,
HttpMethod
.
POST
,
entity
,
new
ParameterizedTypeReference
<
String
>()
{
}).
getBody
();
return
response
;
}
public
RestTemplate
getRestTemplate
()
{
return
restTemplate
;
...
...
fun-common-vo/src/main/java/com/ctrip/fun/common/vo/basic/VoucherItemDTO.java
View file @
4ae5db56
...
...
@@ -45,6 +45,7 @@ public class VoucherItemDTO implements Serializable {
private
String
multiAmount
;
private
Integer
onlyMe
;
//是否本人使用1是本人使用;0是非本人使用
private
Integer
isShare
;
//是否正在分享中
private
Integer
userLimit
;
//领券人限制
private
String
alreadyShared
;
//是否被抢走
private
String
qiangQuanUid
;
//抢券人UID
...
...
@@ -282,6 +283,16 @@ public class VoucherItemDTO implements Serializable {
public
void
setIsShare
(
Integer
isShare
)
{
this
.
isShare
=
isShare
;
}
public
Integer
getUserLimit
()
{
return
userLimit
;
}
public
void
setUserLimit
(
Integer
userLimit
)
{
this
.
userLimit
=
userLimit
;
}
public
String
getAlreadyShared
()
{
...
...
fun-common-vo/src/main/java/com/ctrip/fun/common/vo/order/AbstractOrderBean.java
View file @
4ae5db56
...
...
@@ -106,6 +106,11 @@ public abstract class AbstractOrderBean<T> extends AbstractBean {
private
BigDecimal
discountAfterOrderAmount
;
/**一种折扣*/
private
BigDecimal
discountRate
;
/**
* 推荐人uid
*/
private
String
recommendUid
;
// ------------------
@DateTimeFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
)
...
...
@@ -600,5 +605,12 @@ public abstract class AbstractOrderBean<T> extends AbstractBean {
public
void
setDiscountRate
(
BigDecimal
discountRate
)
{
this
.
discountRate
=
discountRate
;
}
public
String
getRecommendUid
()
{
return
recommendUid
;
}
public
void
setRecommendUid
(
String
recommendUid
)
{
this
.
recommendUid
=
recommendUid
;
}
}
fun-common-vo/src/main/java/com/ctrip/fun/common/vo/order/OrderCategoryEnum.java
View file @
4ae5db56
...
...
@@ -23,6 +23,8 @@ public enum OrderCategoryEnum {
MALL_AFTER_SALES
(
12
,
"商城售后订单"
),
COMMUNE
(
13
,
"公社订单"
),
VOUCHER
(
16
,
"优惠券订单"
),
GAME_ACTIVITY
(
14
,
"赛事活动订单"
),
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment