conycom/laravel-redsys

A clean, modern, and simple Redsys payment gateway integration for Laravel.

Maintainers

Package info

github.com/conycom/laravel-redsys

pkg:composer/conycom/laravel-redsys

Transparency log

Statistics

Installs: 0

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

dev-main 2026-08-12 21:29 UTC

This package is auto-updated.

Last update: 2026-08-13 06:12:43 UTC


README

A clean, modern, and simple Redsys payment gateway integration for Laravel 10, 11, 12, and 13.

Run tests

Features

  • Zero Dependencies: Relies purely on native PHP openssl and hash_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).