laravel-redsys maintained by conycom
Description
A clean, modern, and simple Redsys payment gateway integration for Laravel.
Author
Last update
2026/08/12 23:29
(dev-main)
License
Downloads
0
Laravel Redsys
A clean, modern, and simple Redsys payment gateway integration for Laravel 10, 11, 12, and 13.
Features
- Zero Dependencies: Relies purely on native PHP
opensslandhash_hmac. - Framework Agnostic Models: Doesn't force you to use specific database structures.
- HMAC SHA256 & 3DES encryption: Implements the official Redsys cryptographic requirements.
Installation
composer require conycom/laravel-redsys
Publish the configuration file:
php artisan vendor:publish --tag="redsys-config"
Configuration
Update your .env file with the credentials provided by your bank:
REDSYS_MERCHANT_CODE=123456789
REDSYS_TERMINAL=1
REDSYS_CURRENCY=978
REDSYS_SECRET_KEY=sq7HjrUOBfKmC576ILgskD5srU870gJ7
REDSYS_ENVIRONMENT=sandbox
Usage
1. Generating a Payment Form
use Conycom\Redsys\Facades\Redsys;
$orderId = 'ORD001';
$amount = 15.50; // EUR
$callbackUrl = route('payment.callback');
$form = Redsys::generatePaymentForm($orderId, $amount, $callbackUrl);
// Pass $form['url'] and $form['payload'] to your Blade view to build a form that auto-submits.
2. Processing the Notification / Callback
use Conycom\Redsys\Facades\Redsys;
public function handleCallback(Request $request)
{
$result = Redsys::processNotification($request->all());
if ($result['success']) {
$orderId = $result['order_id'];
$amount = $result['amount'];
// Mark order as paid!
} else {
$error = $result['error'];
// Handle failure
}
}
License
The MIT License (MIT).