@@ -30,6 +30,14 @@ You'll then need to run `composer install` or `composer update` to download it a
30
30
31
31
Once Laravel Paystack is installed, you need to register the service provider. Open up ` config/app.php ` and add the following to the ` providers ` key.
32
32
33
+ ``` php
34
+ 'providers' => [
35
+ ...
36
+ Unicodeveloper\Paystack\PaystackServiceProvider::class,
37
+ ...
38
+ ]
39
+ ```
40
+
33
41
> If you use ** Laravel >= 5.5** you can skip this step and go to [ ** ` configuration ` ** ] ( https://github.com/unicodeveloper/laravel-paystack#configuration )
34
42
35
43
* ` Unicodeveloper\Paystack\PaystackServiceProvider::class `
@@ -197,11 +205,16 @@ Let me explain the fluent methods this package provides a bit here.
197
205
/**
198
206
* This fluent method does all the dirty work of sending a POST request with the form data
199
207
* to Paystack Api, then it gets the authorization Url and redirects the user to Paystack
200
- * Payment Page. I abstracted all of it, so you don't have to worry about that.
208
+ * Payment Page. We've abstracted all of it, so you don't have to worry about that.
201
209
* Just eat your cookies while coding!
202
210
*/
203
211
Paystack::getAuthorizationUrl()->redirectNow();
204
212
213
+ /**
214
+ * Alternatively, use the helper.
215
+ */
216
+ paystack()->getAuthorizationUrl()->redirectNow();
217
+
205
218
/**
206
219
* This fluent method does all the dirty work of verifying that the just concluded transaction was actually valid,
207
220
* It verifies the transaction reference with Paystack Api and then grabs the data returned from Paystack.
@@ -210,55 +223,104 @@ Paystack::getAuthorizationUrl()->redirectNow();
210
223
*/
211
224
Paystack::getPaymentData();
212
225
226
+ /**
227
+ * Alternatively, use the helper.
228
+ */
229
+ paystack()->getPaymentData();
230
+
213
231
/**
214
232
* This method gets all the customers that have performed transactions on your platform with Paystack
215
233
* @returns array
216
234
*/
217
235
Paystack::getAllCustomers();
218
236
237
+ /**
238
+ * Alternatively, use the helper.
239
+ */
240
+ paystack()->getAllCustomers();
241
+
242
+
219
243
/**
220
244
* This method gets all the plans that you have registered on Paystack
221
245
* @returns array
222
246
*/
223
247
Paystack::getAllPlans();
224
248
249
+ /**
250
+ * Alternatively, use the helper.
251
+ */
252
+ paystack()->getAllPlans();
253
+
254
+
225
255
/**
226
256
* This method gets all the transactions that have occurred
227
257
* @returns array
228
258
*/
229
259
Paystack::getAllTransactions();
230
260
261
+ /**
262
+ * Alternatively, use the helper.
263
+ */
264
+ paystack()->getAllTransactions();
265
+
231
266
/**
232
267
* This method generates a unique super secure cryptograhical hash token to use as transaction reference
233
268
* @returns string
234
269
*/
235
270
Paystack::genTranxRef();
236
271
272
+ /**
273
+ * Alternatively, use the helper.
274
+ */
275
+ paystack()->genTranxRef();
276
+
277
+
237
278
/**
238
279
* This method creates a subaccount to be used for split payments
239
280
* @return array
240
281
*/
241
282
Paystack::createSubAccount();
242
283
284
+ /**
285
+ * Alternatively, use the helper.
286
+ */
287
+ paystack()->createSubAccount();
288
+
243
289
244
290
/**
245
291
* This method fetches the details of a subaccount
246
292
* @return array
247
293
*/
248
294
Paystack::fetchSubAccount();
249
295
296
+ /**
297
+ * Alternatively, use the helper.
298
+ */
299
+ paystack()->fetchSubAccount();
300
+
250
301
251
302
/**
252
303
* This method lists the subaccounts associated with your paystack account
253
304
* @return array
254
305
*/
255
306
Paystack::listSubAccounts();
256
307
308
+ /**
309
+ * Alternatively, use the helper.
310
+ */
311
+ paystack()->listSubAccounts();
312
+
313
+
257
314
/**
258
315
* This method Updates a subaccount to be used for split payments
259
316
* @return array
260
317
*/
261
318
Paystack::updateSubAccount();
319
+
320
+ /**
321
+ * Alternatively, use the helper.
322
+ */
323
+ paystack()->updateSubAccount();
262
324
```
263
325
264
326
A sample form will look like so:
0 commit comments