File tree Expand file tree Collapse file tree 1 file changed +49
-0
lines changed Expand file tree Collapse file tree 1 file changed +49
-0
lines changed Original file line number Diff line number Diff line change @@ -127,6 +127,13 @@ public function setResponse($relativeUrl)
127
127
return $ this ;
128
128
}
129
129
130
+ private function setGetResponse ($ relativeUrl )
131
+ {
132
+ $ this ->response = $ this ->client ->get ($ this ->baseUrl . $ relativeUrl , []);
133
+
134
+ return $ this ;
135
+ }
136
+
130
137
/**
131
138
* Get the authorization url from the callback response
132
139
* @return Unicodeveloper\Paystack\Paystack
@@ -220,4 +227,46 @@ public function genTranxRef()
220
227
return TransRef::getHashedToken ();
221
228
}
222
229
230
+ /**
231
+ * Get all the customers that have made transactions on your platform
232
+ * @return array
233
+ */
234
+ public function getAllCustomers ()
235
+ {
236
+ $ this ->setRequestOptions ();
237
+
238
+ return $ this ->setGetResponse ("/customer " )->getData ();
239
+ }
240
+
241
+ /**
242
+ * Get all the plans that you have on Paystack
243
+ * @return array
244
+ */
245
+ public function getAllPlans ()
246
+ {
247
+ $ this ->setRequestOptions ();
248
+
249
+ return $ this ->setGetResponse ("/plan " )->getData ();
250
+ }
251
+
252
+ /**
253
+ * Get all the transactions that have happened overtime
254
+ * @return array
255
+ */
256
+ public function getAllTransactions ()
257
+ {
258
+ $ this ->setRequestOptions ();
259
+
260
+ return $ this ->setGetResponse ("/transaction " )->getData ();
261
+ }
262
+
263
+ /**
264
+ * Get the response from a get operation
265
+ * @return array
266
+ */
267
+ private function getData ()
268
+ {
269
+ return $ this ->response ->json ()["data " ];
270
+ }
271
+
223
272
}
You can’t perform that action at this time.
0 commit comments