Skip to content

Redsys - Create Payment

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.

FieldTypeRequiredDescription
credentials_idcredentialYesRedsys credentials
amountnumberYesAmount in euros (e.g.: 100.00)
order_numberstringYesUnique order number (4-12 characters)
currencyselectNoCurrency (978=EUR, 840=USD, 826=GBP)
card_numberstringNoCard number
expiry_datestringNoExpiry date (YYMM, e.g.: 2512)
cvvstringNoCard CVV
titularstringNoCardholder name
product_descriptionstringNoProduct description
merchant_urlstringNoNotification URL (webhook)
url_okstringNoReturn URL if OK
url_kostringNoReturn URL if KO
direct_paymentbooleanNoDirect payment without redirection
identifierstringNoIdentifier for COF payments

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",
"authorization_code": "123456",
"amount": 100.00,
"currency": "978",
"card_brand": "1",
"message": "Pago autorizado: 0001234567"
}
CodeMeaning
0000-0099Operation approved
0101Expired card
0102Blocked card
0180Invalid card
0184Authentication error
0190Denied without specification
0900-0999Pending operation
{
"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"
}
  • 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
  • RedsysGetPayment - Check payment status
  • RedsysRefund - Refund a completed payment
  • RedsysCreatePreauthorization - Preauthorize instead of charging directly
  • RedsysRecurringPayment - Recurring charges with token