fenixsoft / fenixsoft/monolithic_arch_springboot
关于订单支付
Open
- Dominant language
- Java
- Stars
- 570
- Forks
- 324
- PR merge metrics
- No merged PRs in 30d
Description
PaymentApplicationService中支付订单的逻辑如下,先把订单状态改为支付,再去扣减钱包的钱
这个接口是由"/restful/pay"触发,也就是第三方支付支付成功的前提下才会执行如下逻辑
那么有如下两个问题:
1、第三方支付成功了,为什么还要有这个钱包的概念。
2、如下代码的执行顺序是把订单改为支付成功,再去扣减钱包的余额,但是此时余额不足的情况下,订单状态依然是支付成功的。
public void accomplishPayment(Integer accountId, String payId) {
// 订单从冻结状态变为派送状态,扣减库存
double price = paymentService.accomplish(payId);
// 扣减货款
walletService.decrease(accountId, price);
// 支付成功的清除缓存
settlementCache.evict(payId);
}
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.