This package allows to create a Redsys payment form with the new (December 2015) encryption protocol.
The containing "redsys" package defines two Python classes:
The first one represents a payment transaction. The second one represents the commerce with its secret key and FUC.
pip install redsys-256
from redsys import Commerce, Transaction
commerce = Commerce(secret_key='YOUR_SECRET_KEY', fuc='YOUR_FUC', terminal='YOUR_TERMINAL', url='NOTIF_URL')
transaction = Transaction(amount='100', order'291215112350', url_ok='http://example/ok', url_ko='http://example/ko')
commerce.generate_form(transaction)
This will return a dictionary with the Ds_SignatureVersion, Ds_Signature and Ds_MerchantParameters.