latomate07 / laravel-axepta
Laravel package for BNP Paribas Axepta payment integration
Installs: 0
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 0
Forks: 0
Open Issues: 0
pkg:composer/latomate07/laravel-axepta
Requires
- php: ^8.1
- illuminate/support: ^9.0|^10.0|^11.0
- phpseclib/phpseclib: ^3.0
Requires (Dev)
- orchestra/testbench: ^7.0|^8.0|^9.0
- phpunit/phpunit: ^9.0|^10.0
This package is auto-updated.
Last update: 2025-12-14 12:32:31 UTC
README
A Laravel package for BNP Paribas Axepta payment gateway integration.
Installation
Install the package via composer:
composer require latomate07/laravel-axepta
Publish the configuration file:
php artisan vendor:publish --tag=axepta-config
Configuration
Add the following environment variables to your .env file:
AXEPTA_API_URL=https://paymentpage.axepta.bnpparibas/paymentpage.aspx AXEPTA_MERCHANT_ID=your-merchant-id AXEPTA_BLOWFISH_KEY=your-blowfish-key AXEPTA_HMAC_KEY=your-hmac-key AXEPTA_TEST_MODE=true AXEPTA_DEFAULT_CURRENCY=EUR
Usage
Creating a Payment URL
use TLM\LaravelAxepta\Facades\Axepta; use TLM\LaravelAxepta\Data\PaymentData; $paymentData = new PaymentData( transactionId: 'TXN123', amount: 99.99, notifyUrl: route('payment.notify'), successUrl: route('payment.success'), failureUrl: route('payment.failure'), currency: 'EUR', customerEmail: 'customer@example.com', orderDescription: 'Order #123' ); $paymentUrl = Axepta::createHostedPaymentPageUrl($paymentData); // Redirect user to payment page return redirect($paymentUrl);
Handling Payment Notifications
Create a route to handle payment notifications:
Route::post('/payment/notify', function (Request $request) { $isValid = Axepta::validatePaymentNotification($request->all()); if ($isValid) { $status = $request->input('Status'); $transactionId = $request->input('TransID'); if ($status === 'SUCCESS') { // Payment successful - update your database // Update order status, send confirmation emails, etc. } else { // Payment failed - handle accordingly } return response()->json(['status' => 'success'], 200); } return response()->json(['status' => 'error'], 400); })->name('payment.notify');
Success and Failure Handlers
Route::get('/payment/success', function (Request $request) { // Handle successful payment return view('payment.success'); })->name('payment.success'); Route::get('/payment/failure', function (Request $request) { // Handle failed payment return view('payment.failure'); })->name('payment.failure');
Using PaymentData from Array
$paymentData = PaymentData::fromArray([ 'transaction_id' => 'TXN123', 'amount' => 99.99, 'notify_url' => route('payment.notify'), 'success_url' => route('payment.success'), 'failure_url' => route('payment.failure'), 'currency' => 'EUR', 'customer_email' => 'customer@example.com', 'order_description' => 'Order #123', 'is_test' => false, ]);
Configuration Options
The package supports the following configuration options:
api_url- Axepta API endpoint URLmerchant_id- Your merchant ID provided by BNP Paribasblowfish_key- Blowfish encryption keyhmac_key- HMAC signature keytest_mode- Enable/disable test modedefault_currency- Default currency (EUR)message_version- API message version (2.0)
Security
- All payment data is encrypted using Blowfish encryption
- HMAC signatures are used to verify payment notifications
- Sensitive configuration data should be stored in environment variables
Testing
composer test
Security Vulnerabilities
If you discover a security vulnerability, please send an e-mail to lmtahirou@gmail.com .
See BNP Paribas Axepta Official Documentation
License
The MIT License (MIT). Please see License File for more information.