Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
B
browser-backend
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
browser-backend
Commits
01ab2121
Commit
01ab2121
authored
Mar 15, 2020
by
renjie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
支付返送
parent
77f110c0
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
21 additions
and
21 deletions
+21
-21
AccountController.java
.../browserbackend/account/controller/AccountController.java
+12
-12
PaymentService.java
.../edgec/browserbackend/account/service/PaymentService.java
+2
-2
PaymentServiceImpl.java
...owserbackend/account/service/impl/PaymentServiceImpl.java
+7
-7
No files found.
src/main/java/com/edgec/browserbackend/account/controller/AccountController.java
View file @
01ab2121
...
...
@@ -249,14 +249,14 @@ public class AccountController {
return
paymentService
.
wechatPayCallback
(
tradno
);
}
@RequestMapping
(
path
=
"/0xwxcheckorderstatus/{tradno}"
,
method
=
RequestMethod
.
GET
)
public
UserPaymentDto
wechatCheckOrderStatus
(
Principal
principal
,
@PathVariable
String
tradno
)
{
return
paymentService
.
wxCheckOrderStatus
(
tradno
);
@RequestMapping
(
path
=
"/0xwxcheckorderstatus/{tradno}
/{more}
"
,
method
=
RequestMethod
.
GET
)
public
UserPaymentDto
wechatCheckOrderStatus
(
Principal
principal
,
@PathVariable
String
tradno
,
@PathVariable
int
more
)
{
return
paymentService
.
wxCheckOrderStatus
(
tradno
,
more
);
}
@RequestMapping
(
path
=
"/wxpay/checkstatus/{tradno}"
,
method
=
RequestMethod
.
GET
)
public
UserPaymentDto
wechatPayCheckStatus
(
@PathVariable
String
tradno
)
{
return
paymentService
.
wxCheckOrderStatus
(
tradno
);
@RequestMapping
(
path
=
"/wxpay/checkstatus/{tradno}
/{more}
"
,
method
=
RequestMethod
.
GET
)
public
UserPaymentDto
wechatPayCheckStatus
(
@PathVariable
String
tradno
,
@PathVariable
int
more
)
{
return
paymentService
.
wxCheckOrderStatus
(
tradno
,
more
);
}
@RequestMapping
(
path
=
"/0xalipaycallback/{tradno}"
,
method
=
RequestMethod
.
GET
)
...
...
@@ -264,15 +264,15 @@ public class AccountController {
paymentService
.
alipaCallback
(
tradno
);
}
@RequestMapping
(
path
=
"/0xalicheckorderstatus/{tradno}"
,
method
=
RequestMethod
.
GET
)
public
UserPaymentDto
alipayCheckOrderStatus
(
Principal
principal
,
@PathVariable
String
tradno
)
{
return
paymentService
.
aliCheckOrderStatus
(
tradno
);
@RequestMapping
(
path
=
"/0xalicheckorderstatus/{tradno}
/{more}
"
,
method
=
RequestMethod
.
GET
)
public
UserPaymentDto
alipayCheckOrderStatus
(
Principal
principal
,
@PathVariable
String
tradno
,
@PathVariable
int
more
)
{
return
paymentService
.
aliCheckOrderStatus
(
tradno
,
more
);
}
@RequestMapping
(
path
=
"/alipay/checkstatus/{tradno}"
,
method
=
RequestMethod
.
GET
)
@RequestMapping
(
path
=
"/alipay/checkstatus/{tradno}
/{more}
"
,
method
=
RequestMethod
.
GET
)
@PreAuthorize
(
"#oauth2.hasScope('server')"
)
public
UserPaymentDto
alipayCheckStatus
(
@PathVariable
String
tradno
)
{
return
paymentService
.
aliCheckOrderStatus
(
tradno
);
public
UserPaymentDto
alipayCheckStatus
(
@PathVariable
String
tradno
,
@PathVariable
int
more
)
{
return
paymentService
.
aliCheckOrderStatus
(
tradno
,
more
);
}
@RequestMapping
(
path
=
"/0xalipay/{amount}"
,
method
=
RequestMethod
.
GET
)
...
...
src/main/java/com/edgec/browserbackend/account/service/PaymentService.java
View file @
01ab2121
...
...
@@ -12,9 +12,9 @@ public interface PaymentService {
String
wechatPayCallback
(
String
tradno
);
UserPaymentDto
wxCheckOrderStatus
(
String
tradno
);
UserPaymentDto
wxCheckOrderStatus
(
String
tradno
,
int
more
);
UserPaymentDto
aliCheckOrderStatus
(
String
tradno
);
UserPaymentDto
aliCheckOrderStatus
(
String
tradno
,
int
more
);
void
alipaCallback
(
String
tradno
);
...
...
src/main/java/com/edgec/browserbackend/account/service/impl/PaymentServiceImpl.java
View file @
01ab2121
...
...
@@ -56,7 +56,7 @@ public class PaymentServiceImpl implements PaymentService {
UserPayment
byTradeNo
=
userPaymentRepository
.
findByTradeNo
(
tradno
);
if
(
byTradeNo
!=
null
&&
!
byTradeNo
.
isSucceed
())
{
wxCheckOrderStatus
(
byTradeNo
.
getTradeNo
());
wxCheckOrderStatus
(
byTradeNo
.
getTradeNo
()
,
0
);
}
return
"<xml>\n"
+
"\n"
+
...
...
@@ -70,12 +70,12 @@ public class PaymentServiceImpl implements PaymentService {
UserPayment
byTradeNo
=
userPaymentRepository
.
findByTradeNo
(
tradno
);
if
(
byTradeNo
!=
null
&&
!
byTradeNo
.
isSucceed
())
{
aliCheckOrderStatus
(
byTradeNo
.
getTradeNo
());
aliCheckOrderStatus
(
byTradeNo
.
getTradeNo
()
,
0
);
}
}
@Override
public
UserPaymentDto
wxCheckOrderStatus
(
String
tradeno
)
{
public
UserPaymentDto
wxCheckOrderStatus
(
String
tradeno
,
int
more
)
{
UserPaymentDto
result
=
new
UserPaymentDto
();
result
.
setPaid
(
false
);
...
...
@@ -84,7 +84,7 @@ public class PaymentServiceImpl implements PaymentService {
UserPayment
byTradeNo
=
userPaymentRepository
.
findByTradeNo
(
tradeno
);
if
(
PaymentMethod
.
ALIPAY
.
equals
(
byTradeNo
.
getPaymentMethod
()))
return
aliCheckOrderStatus
(
tradeno
);
return
aliCheckOrderStatus
(
tradeno
,
more
);
UserBalance
balance
=
userBalanceRepository
.
findById
(
byTradeNo
.
getUsername
()).
orElse
(
null
);
...
...
@@ -169,7 +169,7 @@ public class PaymentServiceImpl implements PaymentService {
userPrePaidBillingRepository
.
save
(
bill
);
balance
.
setBalanced
(
balance
.
getBalanced
()
+
byTradeNo
.
getAmount
());
balance
.
setBalanced
(
balance
.
getBalanced
()
+
byTradeNo
.
getAmount
()
+
more
);
userBalanceRepository
.
save
(
balance
);
}
...
...
@@ -201,7 +201,7 @@ public class PaymentServiceImpl implements PaymentService {
}
@Override
public
UserPaymentDto
aliCheckOrderStatus
(
String
tradno
)
{
public
UserPaymentDto
aliCheckOrderStatus
(
String
tradno
,
int
more
)
{
UserPaymentDto
result
=
new
UserPaymentDto
();
result
.
setPaid
(
false
);
try
{
...
...
@@ -271,7 +271,7 @@ public class PaymentServiceImpl implements PaymentService {
bill
.
setYear
(
year
);
bill
.
setMonth
(
monthValue
);
balance
.
setBalanced
(
balance
.
getBalanced
()
+
byTradeNo
.
getAmount
());
balance
.
setBalanced
(
balance
.
getBalanced
()
+
byTradeNo
.
getAmount
()
+
more
);
userBalanceRepository
.
save
(
balance
);
}
...
...
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