File tree 4 files changed +61
-1
lines changed
src/Gateways/Efi/Resources/Charge
4 files changed +61
-1
lines changed Original file line number Diff line number Diff line change 1
1
vendor /
2
2
node_modules /
3
3
examples /asaas /credentials.php
4
- examples /efi /credentials.php
4
+ examples /efi /credentials.php
5
+ .idea /
Original file line number Diff line number Diff line change 28
28
->charge ($ charge )
29
29
->setCustomer ($ customer )
30
30
->create ();
31
+
32
+
33
+ /**
34
+ * get all charges
35
+ * @return array charges
36
+ */
37
+ $ phpay
38
+ ->charge ()
39
+ ->setQueryParams ([
40
+ 'charge_type ' => 'billet ' ,
41
+ 'begin_date ' => '2024-11-01 ' ,
42
+ 'end_date ' => '2024-11-30 ' ,
43
+ 'status ' => 'unpaid '
44
+ ])
45
+ ->getAll ();
Original file line number Diff line number Diff line change @@ -28,6 +28,11 @@ class Charge implements ChargeInterface
28
28
*/
29
29
private array $ items = [];
30
30
31
+ /**
32
+ * @var array<mixed>
33
+ */
34
+ private array $ queryParams = [];
35
+
31
36
/**
32
37
* @var array<mixed>
33
38
*/
@@ -68,6 +73,30 @@ public function setCustomer(array $customer): Charge
68
73
return $ this ;
69
74
}
70
75
76
+ /**
77
+ * set filters
78
+ *
79
+ * @param array<mixed> $queryParams
80
+ * @return ChargeInterface
81
+ * @deprecated
82
+ */
83
+ public function setQueryParams (array $ queryParams ): ChargeInterface
84
+ {
85
+ $ this ->queryParams = $ queryParams ;
86
+
87
+ return $ this ;
88
+ }
89
+
90
+ /**
91
+ * find all charges
92
+ *
93
+ * @return array<array|mixed>
94
+ */
95
+ public function getAll (): array
96
+ {
97
+ return $ this ->get ('v1/charges ' , $ this ->queryParams );
98
+ }
99
+
71
100
/**
72
101
* create charge
73
102
*
Original file line number Diff line number Diff line change 6
6
7
7
interface ChargeInterface
8
8
{
9
+ /**
10
+ * get all charges
11
+ *
12
+ * @return array<array|mixed>
13
+ */
14
+ public function getAll (): array ;
15
+
9
16
/**
10
17
* set customer
11
18
*
12
19
* @param array<mixed> $customer
13
20
* @return Charge
14
21
*/
15
22
public function setCustomer (array $ customer ): Charge ;
23
+
24
+ /**
25
+ * set query params
26
+ *
27
+ * @param array<mixed> $queryParams
28
+ * @return ChargeInterface
29
+ */
30
+ public function setQueryParams (array $ queryParams ): ChargeInterface ;
16
31
}
You can’t perform that action at this time.
0 commit comments