Skip to content

feat: implement fluent facade API for Paystack support classes and ad… - #52

Open
myckhel wants to merge 4 commits into
mainfrom
fluent-api-wrapper
Open

feat: implement fluent facade API for Paystack support classes and ad…#52
myckhel wants to merge 4 commits into
mainfrom
fluent-api-wrapper

Conversation

@myckhel

@myckhel myckhel commented Jul 7, 2026

Copy link
Copy Markdown
Collaborator

…d integration tests

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR introduces a fluent (facade-based) entrypoint for resolving Paystack support classes from Laravel apps, and adds tests + documentation to demonstrate the new usage pattern.

Changes:

  • Expanded Binkode\Paystack\Paystack with fluent endpoint methods (singular/plural) plus a dynamic fallback resolver.
  • Added facade PHPDoc @method annotations to improve IDE autocomplete for fluent calls.
  • Added integration-style tests using Laravel HTTP fakes and updated the README with fluent examples.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 7 comments.

File Description
src/Paystack.php Adds fluent endpoint methods and __call()-based dynamic resolution for support classes.
src/Facades/Paystack.php Adds PHPDoc @method annotations for IDE autocomplete of fluent endpoints.
tests/PaystackTest.php Adds tests for facade resolution and example HTTP calls via Http::fake().
readme.md Documents fluent facade usage alongside the existing static support API usage.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/Paystack.php Outdated
Comment thread src/Paystack.php Outdated
Comment thread src/Facades/Paystack.php Outdated
Comment thread tests/PaystackTest.php
Comment on lines +51 to +54
$response = Paystack::transactions()->initialize([
'amount' => 10000,
'email' => 'user@example.com'
]);
Comment thread tests/PaystackTest.php
Comment on lines +73 to +77
$response = Paystack::customers()->create([
'email' => 'customer@example.com',
'first_name' => 'John',
'last_name' => 'Doe'
]);
Comment thread readme.md
Comment on lines +66 to +75
Using the `Paystack` facade, you can call any support endpoint dynamically as an instance method (supporting both singular and plural forms):

```php
use Binkode\Paystack\Facades\Paystack;

// Initialize a transaction
$init = Paystack::transactions()->initialize([
"email" => "customer@example.com",
"amount" => 500000, // amount in kobo
]);
Comment thread src/Paystack.php
return $mappings[$key];
}

$cleaned = str_replace(['_', '-'], '', $method);
myckhel and others added 3 commits July 7, 2026 01:19
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants