satyam147 / central-payment-gateway
Modular Central Payment Gateway Package
Package info
github.com/satyam147/central-payment-gateway-sdk
pkg:composer/satyam147/central-payment-gateway
0.0.4
2026-03-09 16:55 UTC
Requires
- guzzlehttp/guzzle: ^7.0
README
A modular Laravel package for central payment gateway functionality.
Installation
Require the package in your Laravel project (for local development, use Composer path repository):
composer require satyam147/central-payment-gateway
Service Provider
The package registers its own service provider.
Package Requirements
- Laravel Framework >= 12.0
- guzzlehttp/guzzle >= 7.0
Publish the Config
To publish the config file to your app, run:
php artisan vendor:publish --tag=central-payment-gateway-config
SDK Usage Example
Initialize the client
use Satyam147\CentralPaymentGateway\CentralPaymentGatewayClient; // Easiest: Automatically uses config values from config/central-payment-gateway.php $client = new CentralPaymentGatewayClient(); // Or override config values with explicit arguments $client = new CentralPaymentGatewayClient( 'https://your-gateway.example.com', // baseUrl 'your_public_key', // apiKey 'your_secret_key', // apiSecret );
Initiate a payment
$response = $client->initiatePayment([ 'amount' => 1000, 'currency' => 'INR', // ... other fields ]); $data = json_decode($response->getBody(), true);
Get payment status/details
$response = $client->getPaymentStatus('txn_abc123'); // Your transaction reference $status = json_decode($response->getBody(), true);
Check payment status (manual)
$response = $client->checkPaymentStatus('txn_abc123'); $statusCheck = json_decode($response->getBody(), true);
Refund payment
$response = $client->refundPayment('txn_abc123', [ 'amount' => 500, // partial/main refund amount ]); $refund = json_decode($response->getBody(), true);
Get refund summary
$response = $client->getRefundSummary('txn_abc123'); $summary = json_decode($response->getBody(), true);
See src/CentralPaymentGatewayClient.php for more details.