Skip to content

Latest commit

 

History

16 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Redsys PHP SDK (Nowo)

CI Packagist Version Packagist Downloads License PHP GitHub stars

Found this useful? Install from Packagist · Give it a star on GitHub so more developers can find it.

Clean-room PHP SDK for the public Redsys TPV Virtual protocol (HMAC signing, redirect form, REST SIS). Namespace Nowo\Redsys\. License MIT. Release 1.0.0.

This is an independent implementation written from publicly documented algorithms and endpoints. It does not redistribute Redsys proprietary PHPL_* library source. “Redsys” is a trademark of its respective owners.

FrankenPHP Friendly Worker Mode

This library is FrankenPHP worker mode friendly: RedirectForm returns an HTML string and never calls echo or exit.

Documentation

Quick start

use Nowo\Redsys\Currency;
use Nowo\Redsys\Environment;
use Nowo\Redsys\Merchant;
use Nowo\Redsys\MerchantParameters;
use Nowo\Redsys\RedirectForm;
use Nowo\Redsys\SignatureVersion;
use Nowo\Redsys\TransactionType;

$merchant = new Merchant(
    merchantCode: '999008881',
    terminal: '1',
    secretKey: getenv('REDSYS_SECRET_KEY') ?: '',
    environment: Environment::Test,
    signatureVersion: SignatureVersion::HmacSha512V2,
);

$params = MerchantParameters::create()
    ->forMerchant($merchant)
    ->amount(145)
    ->order('1444904795')
    ->currency(Currency::Eur)
    ->transactionType(TransactionType::Authorization)
    ->merchantUrl('https://example.test/redsys/notify')
    ->urlOk('https://example.test/ok')
    ->urlKo('https://example.test/ko');

$html = RedirectForm::forMerchant($merchant, $params);

Compatibility

PHP 8.3+ with extensions curl, json, openssl.

Installation

composer require nowo-tech/redsys-php:^1.0
require_once 'vendor/autoload.php';

Tests and coverage

composer install
composer test
composer test-coverage

Clover gate: ≥ 99% Lines on src/ (see docs/COVERAGE.md).

make qa
make release-check

Develop

make up && make install && make qa
make setup-hooks

License

MIT — see LICENSE.

Independent clean-room implementation of the public Redsys TPV Virtual protocol. Does not redistribute Redsys proprietary PHPL_* source. “Redsys” is a trademark of its respective owners.

About

Clean-room PHP SDK for the public Redsys TPV protocol (MIT). HMAC signing, redirect, REST. FrankenPHP-friendly.

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages