descom / omnipay-redsys
Redsys driver for Omnipay
Installs: 4 384
Dependents: 1
Suggesters: 1
Security: 0
Stars: 0
Watchers: 0
Forks: 2
Open Issues: 0
pkg:composer/descom/omnipay-redsys
Requires
- php: ^8.3
- descom/redsys: ^1.9
- guzzlehttp/guzzle: ^7.8
- league/omnipay: ^3.2
- omnipay/common: ^3.2
Requires (Dev)
- friendsofphp/php-cs-fixer: ^3.75
- guzzlehttp/psr7: ^1|^2
- omnipay/tests: ^4.1
- phpstan/phpstan: ^2.1
- phpunit/phpunit: ^10.5|^11.5
This package is auto-updated.
Last update: 2026-02-09 15:24:33 UTC
README
Redsys driver for Omnipay
Instalation
composer require descom/omnipay-redsys
Basic Usage
Create purchase request
use Omnipay\Omnipay;
$gateway = Omnipay::create('Redsys');
$gateway->initialize([
'merchantCode' => '999008881',
'merchantTerminal' => '1',
'merchantSignatureKey' => 'sq7HjrUOBfKmC576ILgskD5srU870gJ7',
'testMode' => true,
]);
$request = $gateway->purchase([
'amount' => 12.50,
'description' => 'Test purchase',
'transactionId' => 1,
'notifyUrl' => 'http://localhost:8080/gateway/notify',
])->send();
$response->redirect();
Create purchase request with Bizum
use Omnipay\Omnipay;
$gateway = Omnipay::create('Bizum');
$gateway->initialize([
'merchantCode' => '999008881',
'merchantTerminal' => '1',
'merchantSignatureKey' => 'sq7HjrUOBfKmC576ILgskD5srU870gJ7',
'testMode' => true,
'merchantPaymethods' => 'z',
]);
$request = $gateway->purchase([
'amount' => 12.50,
'description' => 'Test purchase',
'transactionId' => 1,
'notifyUrl' => 'http://localhost:8080/gateway/notify',
])->send();
$response->redirect();
Complete purchase request
use Omnipay\Omnipay;
$gateway = Omnipay::create('Redsys');
$gateway->initialize([
'merchantCode' => '999008881',
'merchantTerminal' => '1',
'merchantSignatureKey' => 'sq7HjrUOBfKmC576ILgskD5srU870gJ7',
'testMode' => true,
]);
$request = $this->gateway->completePurchase();
/*
Redsys notification payment
$_POST = [
'Ds_SignatureVersion' => 'HMAC_SHA256_V1',
'Ds_MerchantParameters' => '...',
'Ds_Signature' => '...',
];
*/
$redsysNotificationData = $_POST;
$response = $request->sendData($redsysNotificationData);
if ($response->isSuccessful()) {
// $dsOrder = $response->transactionId();
// $dsAuthorizationCode = $response->transactionReference();
} else {
// $dsResponse = $response->getCode();
}