feat: add support for Terminal, Virtual Terminal, and Order API integ…#51
Merged
Conversation
…rations with associated controllers and tests
Contributor
There was a problem hiding this comment.
Pull request overview
Adds Paystack Terminal, Virtual Terminal, and Order API support to the package by introducing new support classes/controllers, wiring optional proxy routes, and expanding tests/documentation accordingly.
Changes:
- Added
Terminal,VirtualTerminal, andOrdersupport classes plus matching controllers. - Registered new route mappings in
src/routes.phpand added route registration tests. - Added PHPUnit tests for the new support classes and expanded README guidance; updated Composer deps/lock.
Reviewed changes
Copilot reviewed 13 out of 14 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/Support/VirtualTerminalTest.php | Adds HTTP-fake tests for Virtual Terminal support methods |
| tests/Support/TerminalTest.php | Adds HTTP-fake tests for Terminal support methods (includes a couple request assertions) |
| tests/Support/OrderTest.php | Adds HTTP-fake tests for Order support methods |
| tests/RoutesTest.php | Verifies new controller actions are registered as routes |
| src/Support/VirtualTerminal.php | Introduces Virtual Terminal support wrapper methods |
| src/Support/Terminal.php | Introduces Terminal support wrapper methods |
| src/Support/Order.php | Introduces Order support wrapper methods |
| src/routes.php | Registers Terminal/Virtual Terminal/Order routes and controller bindings |
| src/Http/Controllers/VirtualTerminalController.php | Adds controller adapter for Virtual Terminal routes |
| src/Http/Controllers/TerminalController.php | Adds controller adapter for Terminal routes (special-cases 2-param endpoint) |
| src/Http/Controllers/OrderController.php | Adds controller adapter for Order routes |
| readme.md | Expands usage scenarios and lists new support classes |
| composer.json | Adds direct guzzlehttp/guzzle requirement |
| composer.lock | Updates locked dependencies (notably Guzzle) |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+15
to
+23
| /** | ||
| * Create an order on your integration. | ||
| * | ||
| * @return array | ||
| */ | ||
| static function create($params = []) | ||
| { | ||
| return self::post("/order", $params); | ||
| } |
Comment on lines
+16
to
+24
| /** | ||
| * List terminals available on your integration. | ||
| * | ||
| * @return array | ||
| */ | ||
| static function list($params = []) | ||
| { | ||
| return self::get("/terminal", $params); | ||
| } |
Comment on lines
+16
to
+24
| /** | ||
| * Create a virtual terminal on your integration. | ||
| * | ||
| * @return array | ||
| */ | ||
| static function create($params = []) | ||
| { | ||
| return self::post("/virtual_terminal", $params); | ||
| } |
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Comment on lines
+21
to
+24
| static function list($params = []) | ||
| { | ||
| return self::get("/terminal", $params); | ||
| } |
Comment on lines
+22
to
+24
| $response = VirtualTerminal::create(['title' => 'Test VT']); | ||
| $this->assertTrue($response['status']); | ||
| } |
Comment on lines
+22
to
+24
| $response = Order::create(['product' => 'prod_123']); | ||
| $this->assertTrue($response['status']); | ||
| } |
Comment on lines
+35
to
+37
| $response = Terminal::fetch('term_123'); | ||
| $this->assertTrue($response['status']); | ||
| } |
Comment on lines
13
to
+16
| - Covers a broad set of Paystack endpoints (transactions, customers, transfers, plans, subscriptions, disputes, refunds, and more). | ||
| - Optional built-in HTTP routes for quick API proxying from your Laravel app. | ||
| - Built-in webhook route with signature validation and event dispatching. | ||
| - Compatible with Laravel `10`, `11`, and `12`. | ||
| - Compatible with Laravel `10`, `11`, `12`, and `13`. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
…rations with associated controllers and tests