Skip to content

Redsys - Cancel Preauthorization

This module allows voiding an existing preauthorization in the Redsys payment gateway, releasing the funds held on the customer’s card.

FieldTypeRequiredDescription
credentials_idcredentialYesRedsys credentials
order_numberstringYesPreauthorization order number
amountnumberYesPreauthorization amount
currencyselectNoCurrency (978=EUR by default)
merchant_urlstringNoNotification URL

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",
"amount": 100.00,
"message": "Preautorización anulada: 0001234567"
}
  1. Customer makes a hotel reservation (200 EUR preauthorization)
  2. Customer cancels the reservation
  3. The preauthorization is voided and the 200 EUR become available again
  • Only preauthorizations that have not been confirmed can be voided
  • When voided, the held funds are released immediately
  • The amount indicated must match the original preauthorization
  • If the preauthorization has already expired, voiding is not necessary
  • RedsysCreatePreauthorization - Create the initial preauthorization
  • RedsysConfirmPreauthorization - Confirm instead of voiding
  • RedsysGetPayment - Check operation status