PayRpc.java
4.43 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
package com.diligrp.etrade.rpc;
import com.diligrp.etrade.core.domain.Message;
import com.diligrp.etrade.rpc.config.PayServiceFeignConfig;
import com.diligrp.etrade.rpc.dto.*;
import com.diligrp.etrade.rpc.dto.request.CancelTradeRequestDto;
import com.diligrp.etrade.rpc.dto.request.CreateTradeRequestDto;
import com.diligrp.etrade.rpc.dto.response.BalanceResponseDto;
import com.diligrp.etrade.rpc.dto.response.EcapWeChatRefundVo;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.http.HttpHeaders;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestHeader;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import java.util.Map;
/**
* 支付服务调用
* @author :dengjf
* @date : 2023-08-28
*/
@FeignClient(name = "pay-service" , contextId = "payRpc", configuration = PayServiceFeignConfig.class)
public interface PayRpc {
/**
* 查询余额
* @author dengjf
* @Date 2023-08-18
*/
@RequestMapping(value = "/payment/api/gateway.do?service=payment.fund.service:query", method = RequestMethod.POST)
Message<BalanceResponseDto> getAccountBalance(@RequestBody CreateTradeRequestDto requestDto, @RequestHeader(name = "mchId") String mchId);
/**
*创建交易
* @param requestDto
* @param headers
* @return
*/
@RequestMapping(value = "/payment/api/gateway.do?service=payment.trade.service:prepare", method = RequestMethod.POST)
Message<Map<String,String >> prepare(@RequestBody CreateTradeRequestDto requestDto, @RequestHeader HttpHeaders headers);
/**
*提交交易
* @param commitDto
* @param headers
* @return
*/
@RequestMapping(value = "/payment/api/gateway.do?service=payment.trade.service:commit", method = RequestMethod.POST)
Message<BalanceResponseDto> submit(@RequestBody PaymentTradeCommitDto commitDto, @RequestHeader HttpHeaders headers);
/**
* 撤销交易
* @param cancelDto
* @param headers
* @return
*/
@RequestMapping(value = "/payment/api/gateway.do?service=payment.trade.service:cancel", method = RequestMethod.POST)
Message<BalanceResponseDto> cancel(@RequestBody CancelTradeRequestDto cancelDto, @RequestHeader HttpHeaders headers);
/**
* 微信预支付
* @param requestDto
* @param headers
* @return
*/
@RequestMapping(value = "/wechat/api/gateway.do?service=wechat.payment.service:prepare", method = RequestMethod.POST)
Message<WeChatPayTradeBackDto> wechatPay(@RequestBody WeChatPayTradeDto requestDto, @RequestHeader HttpHeaders headers);
/**
* 微信预支付状态查询
* @param requestDto
* @param headers
* @return
*/
@RequestMapping(value = "/wechat/api/gateway.do?service=wechat.payment.service:state", method = RequestMethod.POST)
Message<WeChatPayFunctionBackDto> wechatPayCheckState(@RequestBody WeChatPayFunctionDto requestDto, @RequestHeader HttpHeaders headers);
/**
* 微信预支付关闭
* @param requestDto
* @param headers
* @return
*/
@RequestMapping(value = "/wechat/api/gateway.do?service=wechat.payment.service:close", method = RequestMethod.POST)
Message<WeChatPayFunctionBackDto> wechatPayClose(@RequestBody WeChatPayFunctionDto requestDto, @RequestHeader HttpHeaders headers);
/**
* 微信预支付历史流水查询
* @param requestDto
* @param headers
* @return
*/
@RequestMapping(value = "/wechat/api/gateway.do?service=wechat.payment.service:statement", method = RequestMethod.POST)
Message<WeChatPayInfoDto> wechatPayInfo(@RequestBody WeChatPayFunctionDto requestDto, @RequestHeader HttpHeaders headers);
/**
* 微信退款
* @param requestDto
* @param headers
* @return
*/
@RequestMapping(value = "/wechat/api/gateway.do?service=wechat.payment.service:refund", method = RequestMethod.POST)
Message<EcapWeChatRefundVo> refund(@RequestBody WeChatPayTradeDto requestDto, @RequestHeader HttpHeaders headers);
/**
* 微信退款
* @param requestDto
* @param headers
* @return
*/
@RequestMapping(value = "/wechat/api/gateway.do?service=wechat.payment.service:exists", method = RequestMethod.POST)
Message<WeChatPayFunctionBackDto> checkWeChatPayChannel(@RequestBody WeChatPayFunctionDto requestDto, @RequestHeader HttpHeaders headers);
}