laravel-xpresspay maintained by koderia-creative-lab
Description
A modern Laravel client and driver for the XpressPay payment gateway.
Author
Last update
2026/11/30 11:31
(dev-main)
License
Downloads
4
Tags
Laravel XpressPay
A modern Laravel client for the XpressPay payment gateway supporting checkout initialization, transaction verification, split payments, metadata parsing, and fee calculation.
Installation
composer require koderia-creative-lab/laravel-xpresspay
Publish configuration:
php artisan vendor:publish --tag="xpresspay-config"
Configuration
Set the following environment variables in .env:
XPRESSPAY_API_KEY=your_public_key
XPRESSPAY_MERCHANT_ID=your_merchant_id
XPRESSPAY_PAYMENT_URL=https://api.xpresspayonline.com/api/Payments/Initialize
XPRESSPAY_VERIFY_URL=https://api.xpresspayonline.com/api/Payments/VerifyPayment
XPRESSPAY_REDIRECT_URL=https://your-app.com/payment/callback
XPRESSPAY_SPLIT_MODE=false
XPRESSPAY_TIMEOUT=30
XPRESSPAY_LOGGING=true
Usage
Initialize a Transaction
use Koderia\XpressPay\Facades\XpressPay;
$response = XpressPay::initialize([
'amount' => '15000',
'transactionId' => 'UNIQUE_TX_REF',
'email' => 'customer@example.com',
'payerName' => 'Ada Lovelace',
'productDescription' => 'Tuition Fee',
'metadata' => ['order_id' => 102],
]);
if ($response->isSuccessful()) {
return redirect($response->getPaymentUrl());
}
$error = $response->getErrorMessage();
Verify a Transaction
use Koderia\XpressPay\Facades\XpressPay;
$verification = XpressPay::verify($transactionId);
if ($verification->isApproved()) {
$amount = $verification->getAmount();
$metadata = $verification->getMetadata();
}
Testing
vendor/bin/phpunit