hiotech / paysortaphp
php package for paysorta
v1.0.7
2026-08-10 08:07 UTC
Requires
- php: ^8.0|^8.1|^8.2|^8.3|^8.5|^8.6
- guzzlehttp/guzzle: ^7.0|^8.0
- vlucas/phpdotenv: ^5.6
Requires (Dev)
None
Suggests
None
Provides
None
Conflicts
None
Replaces
None
README
PHP SDK for Paysorta — initiate payments, generate hosted checkout links, and verify transactions.
Installation
composer require hiotech/paysortaphp
Requirements
- PHP
^8.0–^8.6
Quick start
use Hiotech\PaysortaPhp\Payment; $payment = new Payment($secretkey); $response = $payment->redirectToCheckout([ 'firstName' => 'john', 'lastName' => 'Doe', 'email' => 'customer@example.com', 'amount' => 1000, 'currency' => 'NGN', 'reference' => 'ORDER-123', 'callBackURL' => 'https://example.com/callback', 'metadata' => ['order_id' => 123] ]);
Usage
Redirect straight to checkout
$response = $payment->redirectToCheckout([ 'firstName' => 'john', 'lastName' => 'Doe', 'email' => 'customer@example.com', // required 'amount' => 1000, // required, numeric minimum 1 'currency' => 'NGN', // optional, defaults to NGN 'reference' => 'ORDER-123', 'callBackURL' => 'https://example.com/callback', // optional 'metadata' => ['order_id' => 123] // optional ]);
Verify a transaction
After the customer returns from checkout, verify the payment by its reference:
$result = $payment->verifyPaymentCheckout('PSA_7cdc78f8d732fdb9');
License
MIT