4
4
5
5
namespace Bavix \Wallet \Interfaces ;
6
6
7
- use Bavix \Wallet \Exceptions \BalanceIsEmpty ;
8
- use Bavix \Wallet \Exceptions \InsufficientFunds ;
9
- use Bavix \Wallet \Exceptions \ProductEnded ;
10
- use Bavix \Wallet \Internal \Exceptions \ExceptionInterface ;
11
- use Bavix \Wallet \Internal \Exceptions \LockProviderNotFoundException ;
12
- use Bavix \Wallet \Internal \Exceptions \ModelNotFoundException ;
13
- use Bavix \Wallet \Internal \Exceptions \RecordNotFoundException ;
14
- use Bavix \Wallet \Internal \Exceptions \TransactionFailedException ;
15
7
use Bavix \Wallet \Models \Transfer ;
16
- use Illuminate \Database \RecordsNotFoundException ;
17
8
18
9
interface Customer extends Wallet
19
10
{
20
- /**
21
- * @throws ProductEnded
22
- * @throws BalanceIsEmpty
23
- * @throws InsufficientFunds
24
- * @throws LockProviderNotFoundException
25
- * @throws RecordNotFoundException
26
- * @throws RecordsNotFoundException
27
- * @throws TransactionFailedException
28
- * @throws ExceptionInterface
29
- */
30
11
public function payFree (Product $ product ): Transfer ;
31
12
32
13
public function safePay (Product $ product , bool $ force = false ): ?Transfer ;
33
14
34
- /**
35
- * @throws ProductEnded
36
- * @throws BalanceIsEmpty
37
- * @throws InsufficientFunds
38
- * @throws LockProviderNotFoundException
39
- * @throws RecordNotFoundException
40
- * @throws RecordsNotFoundException
41
- * @throws TransactionFailedException
42
- * @throws ExceptionInterface
43
- */
44
15
public function pay (Product $ product , bool $ force = false ): Transfer ;
45
16
46
- /**
47
- * @throws ProductEnded
48
- * @throws LockProviderNotFoundException
49
- * @throws RecordNotFoundException
50
- * @throws RecordsNotFoundException
51
- * @throws TransactionFailedException
52
- * @throws ExceptionInterface
53
- */
54
17
public function forcePay (Product $ product ): Transfer ;
55
18
56
19
public function safeRefund (Product $ product , bool $ force = false , bool $ gifts = false ): bool ;
57
20
58
- /**
59
- * @throws BalanceIsEmpty
60
- * @throws InsufficientFunds
61
- * @throws LockProviderNotFoundException
62
- * @throws RecordNotFoundException
63
- * @throws RecordsNotFoundException
64
- * @throws TransactionFailedException
65
- * @throws ModelNotFoundException
66
- * @throws ExceptionInterface
67
- */
68
21
public function refund (Product $ product , bool $ force = false , bool $ gifts = false ): bool ;
69
22
70
- /**
71
- * @throws LockProviderNotFoundException
72
- * @throws RecordNotFoundException
73
- * @throws RecordsNotFoundException
74
- * @throws TransactionFailedException
75
- * @throws ModelNotFoundException
76
- * @throws ExceptionInterface
77
- */
78
23
public function forceRefund (Product $ product , bool $ gifts = false ): bool ;
79
24
80
25
public function safeRefundGift (Product $ product , bool $ force = false ): bool ;
81
26
82
- /**
83
- * @throws BalanceIsEmpty
84
- * @throws InsufficientFunds
85
- * @throws LockProviderNotFoundException
86
- * @throws RecordNotFoundException
87
- * @throws RecordsNotFoundException
88
- * @throws TransactionFailedException
89
- * @throws ModelNotFoundException
90
- * @throws ExceptionInterface
91
- */
92
27
public function refundGift (Product $ product , bool $ force = false ): bool ;
93
28
94
- /**
95
- * @throws LockProviderNotFoundException
96
- * @throws RecordNotFoundException
97
- * @throws RecordsNotFoundException
98
- * @throws TransactionFailedException
99
- * @throws ModelNotFoundException
100
- * @throws ExceptionInterface
101
- */
102
29
public function forceRefundGift (Product $ product ): bool ;
103
30
104
31
/**
105
- * @throws ProductEnded
106
- * @throws BalanceIsEmpty
107
- * @throws InsufficientFunds
108
- * @throws LockProviderNotFoundException
109
- * @throws RecordNotFoundException
110
- * @throws RecordsNotFoundException
111
- * @throws TransactionFailedException
112
- * @throws ExceptionInterface
113
- *
114
32
* @return non-empty-array<Transfer>
115
33
*/
116
34
public function payFreeCart (CartInterface $ cart ): array ;
@@ -119,77 +37,25 @@ public function payFreeCart(CartInterface $cart): array;
119
37
public function safePayCart (CartInterface $ cart , bool $ force = false ): array ;
120
38
121
39
/**
122
- * @throws ProductEnded
123
- * @throws BalanceIsEmpty
124
- * @throws InsufficientFunds
125
- * @throws LockProviderNotFoundException
126
- * @throws RecordNotFoundException
127
- * @throws RecordsNotFoundException
128
- * @throws TransactionFailedException
129
- * @throws ExceptionInterface
130
- *
131
40
* @return non-empty-array<Transfer>
132
41
*/
133
42
public function payCart (CartInterface $ cart , bool $ force = false ): array ;
134
43
135
44
/**
136
- * @throws ProductEnded
137
- * @throws LockProviderNotFoundException
138
- * @throws RecordNotFoundException
139
- * @throws RecordsNotFoundException
140
- * @throws TransactionFailedException
141
- * @throws ExceptionInterface
142
- *
143
45
* @return non-empty-array<Transfer>
144
46
*/
145
47
public function forcePayCart (CartInterface $ cart ): array ;
146
48
147
49
public function safeRefundCart (CartInterface $ cart , bool $ force = false , bool $ gifts = false ): bool ;
148
50
149
- /**
150
- * @throws BalanceIsEmpty
151
- * @throws InsufficientFunds
152
- * @throws LockProviderNotFoundException
153
- * @throws RecordNotFoundException
154
- * @throws RecordsNotFoundException
155
- * @throws TransactionFailedException
156
- * @throws ModelNotFoundException
157
- * @throws ExceptionInterface
158
- */
159
51
public function refundCart (CartInterface $ cart , bool $ force = false , bool $ gifts = false ): bool ;
160
52
161
- /**
162
- * @throws LockProviderNotFoundException
163
- * @throws RecordNotFoundException
164
- * @throws RecordsNotFoundException
165
- * @throws TransactionFailedException
166
- * @throws ModelNotFoundException
167
- * @throws ExceptionInterface
168
- */
169
53
public function forceRefundCart (CartInterface $ cart , bool $ gifts = false ): bool ;
170
54
171
55
public function safeRefundGiftCart (CartInterface $ cart , bool $ force = false ): bool ;
172
56
173
- /**
174
- * @throws BalanceIsEmpty
175
- * @throws InsufficientFunds
176
- * @throws LockProviderNotFoundException
177
- * @throws RecordNotFoundException
178
- * @throws RecordsNotFoundException
179
- * @throws TransactionFailedException
180
- * @throws ModelNotFoundException
181
- * @throws ExceptionInterface
182
- */
183
57
public function refundGiftCart (CartInterface $ cart , bool $ force = false ): bool ;
184
58
185
- /**
186
- * @throws LockProviderNotFoundException
187
- * @throws RecordNotFoundException
188
- * @throws RecordsNotFoundException
189
- * @throws TransactionFailedException
190
- * @throws ModelNotFoundException
191
- * @throws ExceptionInterface
192
- */
193
59
public function forceRefundGiftCart (CartInterface $ cart ): bool ;
194
60
195
61
public function paid (Product $ product , bool $ gifts = false ): ?Transfer ;
0 commit comments