Download the PHP package alexasomba/paystack-php without Composer
On this page you can find all versions of the php package alexasomba/paystack-php. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download alexasomba/paystack-php
More information about alexasomba/paystack-php
Files in alexasomba/paystack-php
Package paystack-php
Short Description The OpenAPI specification of the Paystack API that merchants and developers can harness to build financial solutions in Africa.
License unlicense
Homepage https://openapi-generator.tech
Informations about the package paystack-php
Paystack
PHP client for the Paystack API, generated from the Paystack OpenAPI spec in this repository.
Why this SDK
- Generated from the Paystack OpenAPI source of truth in this repo
- Includes opt-in helpers for timeouts, retries, idempotency, and structured API errors
- Keeps generated models and API classes aligned with the SDK generation spec
Requirements
PHP 8.1 and later.
Installation
Or from source:
Authenticate requests with your Paystack secret key through the generated configuration object:
Quick Start
Generated API methods return typed model objects. Catch ApiException when you need raw status codes, headers, or response bodies while debugging.
API Basics
- Base URL:
https://api.paystack.co - HTTPS is required for all requests.
- Requests and responses are JSON-based.
- Most successful responses follow the
status,message,data, and optionalmetaenvelope described inPaystack-API/0a-Introduction.md. - Amounts are usually sent in currency subunits such as kobo, pesewas, or cents. Check the module docs for currency-specific rules.
Authentication & Environments
- Server-side SDKs should use your secret key (
sk_test_*orsk_live_*). - Browser SDKs should use only your public key (
pk_test_*orpk_live_*). - Send server-side API credentials as
Authorization: Bearer YOUR_SECRET_KEY. - Test and live modes use different keys and isolated environments.
- Rotate keys if they are exposed, and never commit secret keys to source control.
- If you enable IP whitelisting in Paystack, requests from non-whitelisted IPs will be blocked.
Reliability
This SDK includes opt-in helpers in Alexasomba\Paystack\Extras:
Use the extras layer when you want one place to set timeout, retry, and idempotency defaults across your application.
Pagination
- Paystack supports both offset pagination and cursor pagination.
- Offset pagination uses
pageandperPage. - Cursor pagination uses
use_cursor=trueplusnextorpreviouscursors returned inmeta. - Cursor pagination is especially useful for large or frequently changing datasets.
- The exact
metashape varies by endpoint and pagination mode.
Coverage
Errors
- Paystack uses conventional HTTP status codes such as
200,201,400,401,404, and5xx. - Error responses typically include
status,message,type,code, and optional diagnosticmetainformation. - Error types described in
Paystack-API/0d-Errors.mdincludeapi_error,validation_error, andprocessor_error. - For charge and verify flows, always inspect the returned response body and status fields, not just the HTTP code.
This SDK is generated from the SDK spec in this monorepo and covers the operations emitted into the generated API classes under lib/Api.
Modules
For this SDK, these schema families are emitted as generated model classes under lib/Model and used by the API classes under lib/Api.
| Module | Schema / model family |
|---|---|
| Transactions | Transaction* |
| Verify Payments (Transaction verification) | VerifyResponse / TransactionFetchResponse |
| Charges | Charge* |
| Bulk Charges | BulkCharge* |
| Subaccounts | Subaccount* |
| Transaction Splits | Split* |
| Terminal | Terminal* |
| Virtual Terminal | VirtualTerminal* |
| Customers | Customer* |
| Direct Debit | DirectDebit* |
| Dedicated Virtual Accounts | DedicatedNuban* / DedicatedVirtualAccount* |
| Apple Pay | ApplePay* |
| Plans | Plan* |
| Subscriptions | Subscription* |
| Transfer Recipients | TransferRecipient* |
| Transfers | Transfer* |
| Transfers Control (OTP settings; under Transfers) | TransferEnable* / TransferDisable* / TransferFinalize* |
| Balance | Balance* |
| Payment Requests (Invoices) | PaymentRequest* |
| Verification (Resolve Account / Validate Account / Resolve Card BIN) | Verification* |
| Products | Product* |
| Storefronts | Storefront* |
| Orders | Order* |
| Payment Pages | Page* |
| Settlements | Settlement* |
| Integration | Integration* |
| Control Panel (Payment session timeout; under Integration) | ControlPanel* |
| Refunds | Refund* |
| Disputes | Dispute* |
| Banks | Bank* |
| Miscellaneous | Miscellaneous* / Currency |
Module Examples
These are intentionally short examples. Use them as entry points, then expand the generated model objects and API method arguments for your use case.
Transactions
Verify Payments (Transaction verification)
Charges
Bulk Charges
Subaccounts
Transaction Splits
Terminal
Virtual Terminal
Customers
Direct Debit
Dedicated Virtual Accounts
Apple Pay
Plans
Subscriptions
Transfer Recipients
Transfers
Transfers Control (OTP settings; under Transfers)
Balance
Payment Requests (Invoices)
Verification (Resolve Account / Validate Account / Resolve Card BIN)
Products
Storefronts
Orders
Payment Pages
Settlements
Integration
Control Panel (Payment session timeout; under Integration)
Refunds
Disputes
Banks
Miscellaneous
Configuration Notes
The generated PHP client still exposes the standard OpenAPI Generator configuration surface. In most integrations, the main requirement is setting the bearer token and optionally swapping in a custom Guzzle client.
Related SDKs
- Node: alexasomba/paystack-node
- Axios: alexasomba/paystack-axios
- Browser: alexasomba/paystack-browser
- Go: alexasomba/paystack-go
- Python: alexasomba/paystack-python
Source
- Monorepo source: alexasomba/paystack-openapi
- Standalone SDK repo: https://github.com/alexasomba/paystack-php
All versions of paystack-php with dependencies
ext-curl Version *
ext-json Version *
ext-mbstring Version *
guzzlehttp/guzzle Version ^7.3
guzzlehttp/psr7 Version ^1.7 || ^2.0