Skip to content

Redsys - Refund

This module allows performing full or partial refunds of payments previously made through the Redsys payment gateway. Partial refunds are cumulative up to the total amount of the original payment.

FieldTypeRequiredDescription
credentials_idcredentialYesRedsys credentials
order_numberstringYesOriginal order number
amountnumberYesAmount to refund in euros
currencyselectNoCurrency (978=EUR by default)
merchant_urlstringNoNotification URL

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": "789012",
"amount": 50.00,
"message": "Devolución realizada: 0001234567 por 50€"
}
  1. Customer purchases a product for 100 EUR
  2. Returns an item worth 30 EUR
  3. A partial refund of 30 EUR is made
  4. Later returns another item worth 70 EUR
  5. A second refund for 70 EUR is made (total refunded: 100 EUR)
  • Only confirmed/authorized payments can be refunded
  • Partial refunds are cumulative
  • The total refunded amount cannot exceed the original payment
  • Refund processing time depends on the issuing bank (1-10 business days)
  • Some banks allow refunds up to 180 days after payment
  • RedsysCreatePayment - Create the original payment
  • RedsysGetPayment - Check payment status before refunding
  • RedsysRecurringPayment - Recurring payments that may require refunds