Redsys - Create Preauthorization
Description
Section titled “Description”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.
Configuration
Section titled “Configuration”| Field | Type | Required | Description |
|---|---|---|---|
| credentials_id | credential | Yes | Redsys credentials |
| amount | number | Yes | Amount to hold in euros |
| order_number | string | Yes | Unique order number |
| currency | select | No | Currency (978=EUR by default) |
| card_number | string | No | Card number |
| expiry_date | string | No | Expiry date (YYMM) |
| cvv | string | No | Card CVV |
| titular | string | No | Cardholder name |
| product_description | string | No | Product description |
| merchant_url | string | No | Notification URL |
| url_ok | string | No | Return URL if OK |
| url_ko | string | No | Return URL if KO |
| direct_payment | boolean | No | Direct payment without redirection |
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", "authorization_code": "123456", "amount": 100.00, "message": "Preautorización creada: 0001234567"}Preauthorization Flow
Section titled “Preauthorization Flow”- Create preauthorization (this module) - Holds the amount on the card
- Confirm preauthorization - Captures the held amount (full or partial)
- Void preauthorization - Releases the amount if not confirmed
Usage Example
Section titled “Usage Example”{ "credentials_id": "redsys_tienda", "amount": 200.00, "order_number": "0001234567", "currency": "978", "direct_payment": false, "merchant_url": "https://mitienda.com/webhook/redsys"}API Used
Section titled “API Used”- API: Redsys REST API
- Transaction type: 1 (Preauthorization)
- Documentation: https://pagosonline.redsys.es/conexion-rest.html
- 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
Related Nodes
Section titled “Related Nodes”- RedsysConfirmPreauthorization - Confirm and charge the preauthorization
- RedsysCancelPreauthorization - Void and release the funds
- RedsysGetPayment - Check preauthorization status