Redsys - Cancel Preauthorization
Description
Section titled “Description”This module allows voiding an existing preauthorization in the Redsys payment gateway, releasing the funds held on the customer’s card.
Configuration
Section titled “Configuration”| Field | Type | Required | Description |
|---|---|---|---|
| credentials_id | credential | Yes | Redsys credentials |
| order_number | string | Yes | Preauthorization order number |
| amount | number | Yes | Preauthorization amount |
| currency | select | No | Currency (978=EUR by default) |
| merchant_url | string | No | Notification URL |
Credentials
Section titled “Credentials”This module requires Redsys type credentials with the following fields:
| Field | Description |
|---|---|
merchant_code | Merchant code (FUC) provided by the bank |
secret_key | SHA-256 signing secret key |
terminal | Terminal number (default: 1) |
test_mode | Test mode (true/false) |
Output
Section titled “Output”{ "success": true, "response_code": "0000", "order": "0001234567", "amount": 100.00, "message": "Preautorización anulada: 0001234567"}Usage Example
Section titled “Usage Example”- Customer makes a hotel reservation (200 EUR preauthorization)
- Customer cancels the reservation
- The preauthorization is voided and the 200 EUR become available again
API Used
Section titled “API Used”- API: Redsys REST API
- Transaction type: 9 (Preauthorization void)
- Documentation: https://pagosonline.redsys.es/conexion-rest.html
- 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
Related Nodes
Section titled “Related Nodes”- RedsysCreatePreauthorization - Create the initial preauthorization
- RedsysConfirmPreauthorization - Confirm instead of voiding
- RedsysGetPayment - Check operation status