Redsys - Recurring Payment (COF)
Description
Section titled “Description”This module allows performing recurring payments using the Credential on File (COF) functionality of Redsys. It allows charging customers without them needing to enter their card data on each transaction, ideal for subscriptions and periodic payments.
Configuration
Section titled “Configuration”| Field | Type | Required | Description |
|---|---|---|---|
| credentials_id | credential | Yes | Redsys credentials |
| amount | number | Yes | Charge amount in euros |
| order_number | string | Yes | Unique order number |
| identifier | string | Yes | COF identifier (from the first transaction) |
| currency | select | No | Currency (978=EUR by default) |
| cof_type | select | No | COF operation type |
| cof_ini | select | No | Sequence indicator (S=First, N=Subsequent) |
| product_description | string | No | Charge description |
| exempt_authentication | boolean | No | Exempt from 3DS authentication (MIT) |
| 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) |
COF Types (cof_type)
Section titled “COF Types (cof_type)”| Value | Description |
|---|---|
| R | Recurring (subscriptions) |
| I | Installment |
| H | Reauthorization |
| E | Resubmission |
| D | Delayed |
| M | Incremental |
| N | No-show |
Output
Section titled “Output”{ "success": true, "response_code": "0000", "order": "0001234567", "authorization_code": "345678", "amount": 9.99, "identifier": "12345678901234567890", "message": "Pago recurrente autorizado: 0001234567"}Recurring Payments Flow
Section titled “Recurring Payments Flow”- First transaction (cof_ini=S): The customer pays with 3D Secure
- Obtain the
identifierfrom the response - Save for future charges
- Obtain the
- Subsequent transactions (cof_ini=N): Charges without customer intervention
- Use the saved
identifier - Does not require 3DS authentication
- Use the saved
Usage Example
Section titled “Usage Example”{ "credentials_id": "redsys_tienda", "amount": 9.99, "order_number": "SUB-202401-001", "identifier": "12345678901234567890", "cof_type": "R", "cof_ini": "N", "exempt_authentication": true, "product_description": "Suscripcion mensual Premium"}API Used
Section titled “API Used”- API: Redsys REST API
- Transaction type: 0 (Authorization) with COF parameters
- Documentation: https://pagosonline.redsys.es/conexion-rest.html
- The
identifieris provided by Redsys in the first transaction - Subsequent charges do not require card data
- MIT (Merchant Initiated Transaction) exemption avoids 3D Secure
- Ideal for subscriptions, memberships, and periodic payments
Related Nodes
Section titled “Related Nodes”- RedsysCreatePayment - Create the first payment to obtain the identifier
- RedsysGetPayment - Check recurring charge status
- RedsysRefund - Refund a recurring charge