payxy / laravel-payment-checkout
Laravel SDK for Payxy Payment Gateway
Package info
github.com/Proximaforte/payxy-laravel-checkout
pkg:composer/payxy/laravel-payment-checkout
Requires
- php: ^8.2
- guzzlehttp/guzzle: ^7.0
- illuminate/support: ^10.0|^11.0|^12.0
- phpseclib/phpseclib: ^3.0
This package is auto-updated.
Last update: 2026-03-31 18:48:49 UTC
README
A lightweight and easy-to-use Laravel SDK for integrating the Payxy Payment Gateway. This package supports Card, Bank Transfer, and USSD payments, including a pre-built Blade component for seamless checkout.
Installation
You can install the package via composer:
composer require payxy/laravel-checkout
The package will automatically register its service provider and facade.
Configuration
Publish the configuration file to your project:
php artisan vendor:publish --tag="payxy-config"
This will create a config/payxy.php file. You should then add your Payxy credentials to your .env file:
PAYXY_BASE_URL=https://api.payxy.africa PAYXY_API_TOKEN=your_api_token_here PAYXY_PUBLIC_KEY=your_public_key_here
Usage
1. Frontend Checkout (Blade Component)
To use the inline checkout, simply drop the <x-payxy-checkout /> component into your Blade view.
<x-payxy-checkout :reference="'TXN_' . time()" :amount="5000" :email="'customer@example.com'" />
2. Backend API (Facade)
You can use the Payxy facade to interact with the API directly for server-side payment initialization or bank lists.
Get USSD Banks
use Payxy\Checkout\Facades\Payxy; $banks = Payxy::getUSSDBanks();
Initiate Bank Transfer or USSD Payment
use Payxy\Checkout\Facades\Payxy; $paymentInfo = [ 'reference' => 'TXN_123456', 'amount' => 5000, 'email' => 'customer@example.com', 'callbackUrl' => route('payment.callback'), ]; // For USSD $response = Payxy::initiatePayment($paymentInfo, 'USSD', '058'); // 058 is GTBank code // For Bank Transfer $response = Payxy::initiatePayment($paymentInfo, 'BANK_TRANSFER');
Verify Webhook Signature
Ensure your webhook endpoints are secure by verifying the signature:
use Payxy\Checkout\Facades\Payxy; $payload = $request->getContent(); $signature = $request->header('X-Payxy-Signature'); $secret = config('payxy.api_token'); if (Payxy::verifyWebhook($payload, $signature, $secret)) { // Valid request, process the payment }
Testing
composer test
License
The MIT License (MIT). Please see License File for more information.