Download the PHP package basgate/laravel-payment-sdk without Composer
On this page you can find all versions of the php package basgate/laravel-payment-sdk. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download basgate/laravel-payment-sdk
More information about basgate/laravel-payment-sdk
Files in basgate/laravel-payment-sdk
Package laravel-payment-sdk
Short Description Laravel Payment Gateway SDK for BAS Platform - API-only payment integration
License MIT
Informations about the package laravel-payment-sdk
Laravel Payment Gateway SDK for BAS Platform
This SDK provides API-only payment integration with the BAS Super App platform for Laravel applications. It allows merchants to accept payments through BAS wallet and various payment methods supported by the BAS platform without requiring a Mini App implementation.
Features
- ✅ Payment Initiation - Start payment transactions
- ✅ Transaction Status - Check payment status
- ✅ Refund Processing - Process refunds
- ✅ Token Authentication - Automatic bearer token management
- ✅ Signature Verification - Secure API communication with AES-256-CBC encryption
- ✅ API-Only - No UI, routes, or controllers (pure backend SDK)
Installation
-
Require the package via Composer:
- The service provider will be automatically registered via Laravel's package auto-discovery.
Requirements
- PHP: 8.1, 8.2, or 8.3
- Laravel: 10.x, 11.x, or 12.x
- PHP Extensions: OpenSSL, JSON
This package uses modern PHP features including typed properties, union types, and return type declarations.
Configuration
-
Add your BAS credentials to your
.envfile: -
Environment Variable Descriptions:
BAS_BASE_URL: The base URL for the BAS API platform- Staging:
https://api-tst.basgate.com - Production:
https://api.basgate.com
- Staging:
BAS_CLIENT_ID: Your Client ID provided by BASBAS_CLIENT_SECRET: Your Client Secret (keep this secure)BAS_APP_ID: Your App ID provided by BASBAS_MERCHANT_KEY: Merchant Key for signature generationBAS_IV: (Optional) 16-byte Initialization Vector - uses BAS default if not setBAS_ENVIRONMENT: Set tostagingorproduction
Security Notes:
- Never hardcode credentials in your code
- Keep your merchant key secure and never commit it to version control
- The IV uses a default constant provided by BAS - only override if instructed by BAS support
- Keep
BAS_CLIENT_SECRETandBAS_MERCHANT_KEYsecure - Do not commit credentials to version control
Usage
Using the Facade
Check Transaction Status
Process Refund
Send Notification
API Methods
initiateTransaction($orderId, $amount, $currency)
Initiates a new payment transaction.
Parameters:
$orderId(string): Unique order identifier$amount(float): Payment amount$currency(string): Currency code (e.g., 'YER', 'USD')
Returns: Array with transaction details including trxToken
checkTransactionStatus($orderId)
Checks the status of a payment transaction.
Parameters:
$orderId(string): Order identifier
Returns: Array with transaction status
refund($trxToken, $reason = 'test')
Processes a refund for a completed transaction.
Parameters:
$trxToken(string): Transaction token from initiate response$reason(string): Reason for refund (optional)
Returns: Array with refund status
Response Format
All API responses follow this structure:
Complete Example
Security
This SDK uses AES-256-CBC encryption with HMAC-SHA256 for signature generation and verification. All API requests are authenticated using bearer tokens that are automatically managed by the SDK.
Conflict Prevention
This SDK is designed to coexist with the BAS Mini App SDK (basgate/laravel-sdk). Both packages can be installed in the same Laravel application without conflicts:
- Different Package Name:
basgate/laravel-payment-sdkvsbasgate/laravel-sdk - Different Namespace:
Bas\LaravelPayment\vsBas\LaravelSdk\ - Different Facade:
BasPaymentvsBAS - Different Config:
bas-paymentvsbas
Requirements
- PHP 7.4 or higher
- Laravel 8.x, 9.x, 10.x, or 11.x
Updating
To update to the latest version:
Changelog
See CHANGELOG.md for release notes and version history.
Contributing
Contributions are welcome! Please see CONTRIBUTING.md for details.
Security
If you discover any security vulnerabilities, please review our Security Policy.
License
This package is open-sourced software licensed under the MIT license.
Support
- Contact BAS technical support
- Refer to the official BAS API documentation