0
# Enterprise Services
1
2
Enterprise-level payment services including payments to individuals, red packet distribution, and profit sharing functionality.
3
4
## Capabilities
5
6
### Enterprise Payments
7
8
Transfer funds from merchant account to individual users.
9
10
```java { .api }
11
/**
12
* Send enterprise payment to individual user
13
* @param request Enterprise payment request
14
* @return Payment result with transaction details
15
* @throws WxPayException if payment fails
16
*/
17
EntPayResult entPay(EntPayRequest request) throws WxPayException;
18
19
/**
20
* Query enterprise payment status
21
* @param request Payment query request
22
* @return Payment query result
23
* @throws WxPayException if query fails
24
*/
25
EntPayQueryResult queryEntPay(EntPayQueryRequest request) throws WxPayException;
26
```
27
28
**Usage Example:**
29
30
```java
31
// Send payment to user
32
EntPayRequest request = EntPayRequest.newBuilder()
33
.partnerTradeNo("ENT_PAY_001")
34
.openid("user-openid")
35
.amount(100) // Amount in cents
36
.desc("Refund payment")
37
.spbillCreateIp("192.168.1.1")
38
.build();
39
40
EntPayResult result = wxPayService.entPay(request);
41
```
42
43
### Red Packet Distribution
44
45
Send promotional red packets to users.
46
47
```java { .api }
48
/**
49
* Send red packet to user
50
* @param request Red packet request
51
* @return Red packet result
52
* @throws WxPayException if sending fails
53
*/
54
WxPaySendRedpackResult sendRedpack(WxPaySendRedpackRequest request) throws WxPayException;
55
56
/**
57
* Query red packet status
58
* @param request Red packet query request
59
* @return Query result with red packet details
60
* @throws WxPayException if query fails
61
*/
62
WxPayRedpackQueryResult queryRedpack(WxPayRedpackQueryRequest request) throws WxPayException;
63
```
64
65
### Profit Sharing
66
67
Distribute transaction profits among multiple parties.
68
69
```java { .api }
70
/**
71
* Execute profit sharing
72
* @param request Profit sharing request
73
* @return Sharing result
74
* @throws WxPayException if sharing fails
75
*/
76
ProfitSharingResult profitSharing(ProfitSharingRequest request) throws WxPayException;
77
78
/**
79
* Add profit sharing receiver
80
* @param request Receiver addition request
81
* @return Addition result
82
* @throws WxPayException if addition fails
83
*/
84
ProfitSharingReceiverResult addReceiver(ProfitSharingAddReceiverRequest request) throws WxPayException;
85
```
86
87
## Service Access
88
89
### Get Enterprise Services
90
91
```java { .api }
92
/**
93
* Get enterprise payment service
94
* @return Enterprise payment service instance
95
*/
96
EntPayService getEntPayService();
97
98
/**
99
* Get red packet service
100
* @return Red packet service instance
101
*/
102
RedpackService getRedpackService();
103
104
/**
105
* Get profit sharing service
106
* @return Profit sharing service instance
107
*/
108
ProfitSharingService getProfitSharingService();
109
```