Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 29 additions & 1 deletion readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,35 @@ return [

## Quick Usage

Call support classes directly:
You can call the support classes statically or use the fluent facade wrapper APIs:

### 1. Fluent/Facade API Wrapper (Recommended for IDE Autocomplete)

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 on lines +66 to +75

// Verify a transaction
$verify = Paystack::transaction()->verify("reference_here");

// Create a customer
$customer = Paystack::customers()->create([
"email" => "customer@example.com",
"first_name" => "Jane",
"last_name" => "Doe",
]);
```

### 2. Static Support API

Alternatively, you can call methods directly on the support classes statically:

```php
use Binkode\Paystack\Support\Transaction;
Expand Down
54 changes: 54 additions & 0 deletions src/Facades/Paystack.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,60 @@

use Illuminate\Support\Facades\Facade;

/**
* @method static \Binkode\Paystack\Support\ApplePay applePay()
* @method static \Binkode\Paystack\Support\ApplePay applePays()
* @method static \Binkode\Paystack\Support\BulkCharge bulkCharge()
* @method static \Binkode\Paystack\Support\BulkCharge bulkCharges()
* @method static \Binkode\Paystack\Support\Charge charge()
* @method static \Binkode\Paystack\Support\Charge charges()
* @method static \Binkode\Paystack\Support\ControlPanel controlPanel()
* @method static \Binkode\Paystack\Support\ControlPanel controlPanels()
* @method static \Binkode\Paystack\Support\Customer customer()
* @method static \Binkode\Paystack\Support\Customer customers()
* @method static \Binkode\Paystack\Support\DedicatedVirtualAccount dedicatedVirtualAccount()
* @method static \Binkode\Paystack\Support\DedicatedVirtualAccount dedicatedVirtualAccounts()
* @method static \Binkode\Paystack\Support\Dispute dispute()
* @method static \Binkode\Paystack\Support\Dispute disputes()
* @method static \Binkode\Paystack\Support\Invoice invoice()
* @method static \Binkode\Paystack\Support\Invoice invoices()
* @method static \Binkode\Paystack\Support\Miscellaneous miscellaneous()
* @method static \Binkode\Paystack\Support\Miscellaneous miscellaneouses()
* @method static \Binkode\Paystack\Support\Order order()
Comment thread
Copilot marked this conversation as resolved.
Outdated
* @method static \Binkode\Paystack\Support\Order orders()
* @method static \Binkode\Paystack\Support\Page page()
* @method static \Binkode\Paystack\Support\Page pages()
* @method static \Binkode\Paystack\Support\Plan plan()
* @method static \Binkode\Paystack\Support\Plan plans()
* @method static \Binkode\Paystack\Support\Product product()
* @method static \Binkode\Paystack\Support\Product products()
* @method static \Binkode\Paystack\Support\Recipient recipient()
* @method static \Binkode\Paystack\Support\Recipient recipients()
* @method static \Binkode\Paystack\Support\Refund refund()
* @method static \Binkode\Paystack\Support\Refund refunds()
* @method static \Binkode\Paystack\Support\Settlement settlement()
* @method static \Binkode\Paystack\Support\Settlement settlements()
* @method static \Binkode\Paystack\Support\Split split()
* @method static \Binkode\Paystack\Support\Split splits()
* @method static \Binkode\Paystack\Support\SubAccount subAccount()
* @method static \Binkode\Paystack\Support\SubAccount subAccounts()
* @method static \Binkode\Paystack\Support\Subscription subscription()
* @method static \Binkode\Paystack\Support\Subscription subscriptions()
* @method static \Binkode\Paystack\Support\Terminal terminal()
* @method static \Binkode\Paystack\Support\Terminal terminals()
* @method static \Binkode\Paystack\Support\Transaction transaction()
* @method static \Binkode\Paystack\Support\Transaction transactions()
* @method static \Binkode\Paystack\Support\Transfer transfer()
* @method static \Binkode\Paystack\Support\Transfer transfers()
* @method static \Binkode\Paystack\Support\TransferControl transferControl()
* @method static \Binkode\Paystack\Support\TransferControl transferControls()
* @method static \Binkode\Paystack\Support\Verification verification()
* @method static \Binkode\Paystack\Support\Verification verifications()
* @method static \Binkode\Paystack\Support\VirtualTerminal virtualTerminal()
* @method static \Binkode\Paystack\Support\VirtualTerminal virtualTerminals()
*
* @see \Binkode\Paystack\Paystack
*/
class Paystack extends Facade
{
/**
Expand Down
Loading
Loading