Skip to content

Redsys - Create Preauthorization

This module allows creating a preauthorization (fund hold) in the Redsys payment gateway. Funds are held on the customer’s card without charging, and can be confirmed or voided later.

FieldTypeRequiredDescription
credentials_idcredentialYesRedsys credentials
amountnumberYesAmount to hold in euros
order_numberstringYesUnique order number
currencyselectNoCurrency (978=EUR by default)
card_numberstringNoCard number
expiry_datestringNoExpiry date (YYMM)
cvvstringNoCard CVV
titularstringNoCardholder name
product_descriptionstringNoProduct description
merchant_urlstringNoNotification URL
url_okstringNoReturn URL if OK
url_kostringNoReturn URL if KO
direct_paymentbooleanNoDirect payment without redirection

This module requires Redsys type credentials with the following fields:

FieldDescription
merchant_codeMerchant code (FUC) provided by the bank
secret_keySHA-256 signing secret key
terminalTerminal number (default: 1)
test_modeTest mode (true/false)
{
"success": true,
"response_code": "0000",
"order": "0001234567",
"authorization_code": "123456",
"amount": 100.00,
"message": "Preautorización creada: 0001234567"
}
  1. Create preauthorization (this module) - Holds the amount on the card
  2. Confirm preauthorization - Captures the held amount (full or partial)
  3. Void preauthorization - Releases the amount if not confirmed
{
"credentials_id": "redsys_tienda",
"amount": 200.00,
"order_number": "0001234567",
"currency": "978",
"direct_payment": false,
"merchant_url": "https://mitienda.com/webhook/redsys"
}
  • The preauthorization holds funds without charging
  • It must be confirmed within a maximum period (usually 7-30 days depending on the bank)
  • It can be confirmed for an amount less than preauthorized
  • If not confirmed, the amount is released automatically
  • RedsysConfirmPreauthorization - Confirm and charge the preauthorization
  • RedsysCancelPreauthorization - Void and release the funds
  • RedsysGetPayment - Check preauthorization status