Redsys - Create Payment
Description
Section titled “Description”This module allows creating a payment or authorization in the Redsys payment gateway. It supports direct payments (with card data) and payments with redirection to the Redsys secure form.
Configuration
Section titled “Configuration”| Field | Type | Required | Description |
|---|---|---|---|
| credentials_id | credential | Yes | Redsys credentials |
| amount | number | Yes | Amount in euros (e.g.: 100.00) |
| order_number | string | Yes | Unique order number (4-12 characters) |
| currency | select | No | Currency (978=EUR, 840=USD, 826=GBP) |
| card_number | string | No | Card number |
| expiry_date | string | No | Expiry date (YYMM, e.g.: 2512) |
| cvv | string | No | Card CVV |
| titular | string | No | Cardholder name |
| product_description | string | No | Product description |
| merchant_url | string | No | Notification URL (webhook) |
| url_ok | string | No | Return URL if OK |
| url_ko | string | No | Return URL if KO |
| direct_payment | boolean | No | Direct payment without redirection |
| identifier | string | No | Identifier for COF payments |
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, "currency": "978", "card_brand": "1", "message": "Pago autorizado: 0001234567"}Response Codes
Section titled “Response Codes”| Code | Meaning |
|---|---|
| 0000-0099 | Operation approved |
| 0101 | Expired card |
| 0102 | Blocked card |
| 0180 | Invalid card |
| 0184 | Authentication error |
| 0190 | Denied without specification |
| 0900-0999 | Pending operation |
Usage Example
Section titled “Usage Example”{ "credentials_id": "redsys_tienda", "amount": 49.99, "order_number": "0001234567", "currency": "978", "direct_payment": false, "merchant_url": "https://mitienda.com/webhook/redsys", "url_ok": "https://mitienda.com/pago-ok", "url_ko": "https://mitienda.com/pago-error"}API Used
Section titled “API Used”- API: Redsys REST API
- Transaction type: 0 (Authorization)
- Documentation: https://pagosonline.redsys.es/conexion-rest.html
- The order number must be unique per transaction
- The amount is automatically converted to cents
- For redirect payments, card data is not sent
- Test mode uses the sis-t.redsys.es environment
Related Nodes
Section titled “Related Nodes”- RedsysGetPayment - Check payment status
- RedsysRefund - Refund a completed payment
- RedsysCreatePreauthorization - Preauthorize instead of charging directly
- RedsysRecurringPayment - Recurring charges with token