Skip to content

Commit f922f15

Browse files
docs(Readme): Update readme 💳
1 parent bfec019 commit f922f15

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

README.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,25 @@ class PaymentController extends Controller
159159
}
160160
}
161161
```
162+
Let me explain the two main fluent methods a bit here.
163+
164+
```php
165+
/**
166+
* This fluent method does all the dirty work of sending a POST request with the form data
167+
* to Paystack Api, then it gets the authorization Url and redirects the user to Paystack
168+
* Payment Page. I abstracted all of it, so you don't have to worry about that.
169+
* Just eat your cookies :cookie: while coding!
170+
*/
171+
Paystack::getAuthorizationUrl()->redirectNow();
172+
173+
/**
174+
* This fluent method does all the dirty work of verifying that the just concluded transaction was actually valid,
175+
* It verifies the transaction reference with Paystack Api and then grabs the data returned from Paystack.
176+
* In that data, we have a lot of good stuff, especially the authorisation code that you can save in your db
177+
* to allow for easy recurrent subscription.
178+
*/
179+
Paystack::getPaymentData();
180+
```
162181

163182
A sample form will look like so:
164183

0 commit comments

Comments
 (0)