diff --git a/readme.md b/readme.md index 1f6b432..d5c396c 100644 --- a/readme.md +++ b/readme.md @@ -238,7 +238,15 @@ Invoice::finalize($code, $params); Invoice::archive($code, $params); ``` -### Settlements **TODO** +### Settlements +```php +use Myckhel\Paystack\Support\Settlement; + +Settlement::list($params); + +Settlement::transactions($settlement, $params); +``` + ### Transfer Recipients **TODO** ### Transfers **TODO** ### Transfers Control **TODO** @@ -249,8 +257,6 @@ Invoice::archive($code, $params); ### Refunds **TODO** ### Verification **TODO** ### Miscellaneous **TODO** -```php -``` ### Using WebHook route Laravel paystack provides you a predefined endpoint that listens to and validates incoming paystack's webhook events. diff --git a/src/Http/Controllers/SettlementController.php b/src/Http/Controllers/SettlementController.php new file mode 100644 index 0000000..b592f90 --- /dev/null +++ b/src/Http/Controllers/SettlementController.php @@ -0,0 +1,15 @@ +all()) + : Settlement::$method(request()->all()); + } +} diff --git a/src/Support/Settlement.php b/src/Support/Settlement.php new file mode 100644 index 0000000..a19dbc7 --- /dev/null +++ b/src/Support/Settlement.php @@ -0,0 +1,35 @@ + 'invoice,totals', 'post,paymentrequest/finalize/{invoice_code}' => 'invoice,finalize', 'post,paymentrequest/archive/{invoice_code}' => 'invoice,archive', + // settlements + 'get,settlement' => 'settlement,list', + 'get,settlement/{settlement}/transactions' => 'settlement,transactions', ]; $controls = [ @@ -115,6 +119,7 @@ 'product' => ProductController::class, 'page' => PageController::class, 'invoice' => InvoiceController::class, + 'settlement' => SettlementController::class, ]; collect($routes)->map(function ($route, $index) use ($controls) {