Redsys for PrestaShop API
14 specialized services, 28 controllers, and a complete integration surface for PrestaShop developers.
Integration model
Redsys for PrestaShop is a standard PrestaShop module (PrestaShop 8+, PHP 8.1+). It does not expose a general-purpose transactions REST API: there is no WebserviceRequest resource and no public JSON endpoint to query or mutate transactions remotely. Instead, the integration surface is the conventional PrestaShop one — front controllers (the payment, return and notification URLs), admin controllers (back-office tabs), a layer of internal services, a payment-capability registry, and module hooks.
If you need to query orders or issue refunds programmatically from an external system, use PrestaShop's own core Webservice (the /api resource) over your store data, and customize the Redsys flow through the module's hooks. To automate payments over a dedicated API, the WooCommerce Redsys Gateway exposes a full A2A / UCP REST API.
Note: the module ships a RedsysRestService internally — that is the client the module uses to talk to Redsys's own REST API for InSite payments. It is not an API the module exposes to third parties.
Front-controller URLs
Front controllers live under controllers/front/ and are reached through PrestaShop's module link, for example:
# Built in code with $this->context->link->getModuleLink('ps_redsys_gateway', '<controller>')
https://your-store.com/index.php?fc=module&module=ps_redsys_gateway&controller=<controller>
# or, with friendly URLs enabled
https://your-store.com/module/ps_redsys_gateway/<controller>
The controllers below are the ones a developer typically needs to know about. They are visited by the shopper's browser or called server-to-server by Redsys; they are not a query API.
| Controller | Role |
|---|---|
payment | Initiates the payment and redirects the shopper to Redsys |
validation | Validates payment data for InSite and other embedded methods |
ipn | Receives the signed Instant Payment Notification from Redsys (server-to-server) |
confirmation | Handles the successful return from Redsys (can settle via IPN or URL params) |
return | Handles failed / cancelled returns from Redsys |
paygoldipn | IPN endpoint for Paygold payment links |
savedcardpayment / oneclickpayment | Payment with a stored card / one-click checkout |
bizumpayment / insitepayment | Bizum and InSite (embedded card) payment entry points |
expresspay / googlepaycheckoutpayment / applepaycheckoutpayment | Express checkout (Apple Pay, Google Pay, one-click) handlers |
cron | Scheduled tasks (card-expiry notifications, maintenance) |
Notification (IPN)
Payment settlement is driven by Redsys's signed server-to-server notification, not by the shopper's browser. You configure this URL in your Redsys (RedsysHMAC) terminal as the "URL de notificación / merchant URL". The module exposes it through the ipn front controller.
https://your-store.com/index.php?fc=module&module=ps_redsys_gateway&controller=ipn
# Paygold payment links use a dedicated endpoint
https://your-store.com/index.php?fc=module&module=ps_redsys_gateway&controller=paygoldipn
The controller verifies the Redsys HMAC-SHA256 signature on the Ds_Signature / Ds_MerchantParameters payload before changing any order state. Around this processing the module fires the actionRedsysBeforeIPNProcess and actionRedsysAfterIPNProcess hooks — see the hooks reference to plug in your own logic.
Services & capabilities
Business logic lives in PSR-4 service classes under src/Service/ (namespace RedsysGateway\Service\). These are internal building blocks you can reuse from an override or a companion module; they are not network endpoints.
| Service | Responsibility |
|---|---|
RedsysRefundService | Executes full and partial refunds against Redsys |
TokenManagementService | Stores, lists and deletes saved-card tokens |
PreauthorizationService | Pre-authorization and later capture |
PaygoldService | Paygold payment-link generation |
ExpressCheckoutService / ApplePayService / GooglePayService / OneClickService | Express and wallet checkout flows |
RedsysOrderNumberService | Builds and parses the Redsys order number (Ds_Merchant_Order) |
RedsysRestService / InespayApiService | Clients for the Redsys and Inespay REST APIs |
PaymentFilterService | Controls which payment methods are offered |
LogManagementService / LicenseService | Logging and license handling |
Payment capabilities are registered through a small registry under src/Capability/ (CapabilityRegistry with PreauthCapability, RefundCapability and TokenRCapability). Third parties can register and query capabilities through the actionRegisterPaymentCapabilities and actionCheckPaymentCapability hooks.
Admin controllers
Back-office tabs live under controllers/admin/. They render inside PrestaShop's admin and are protected by the usual employee permissions.
| Controller | Purpose |
|---|---|
AdminRedsysLogsController | Browse and export the gateway transaction logs |
AdminRedsysTokensController | Manage stored card tokens |
AdminRedsysPaygoldController | Create and track Paygold payment links |
AdminRedsysLicenseController | Activate and manage the module license |
Configuration
All settings are stored through PrestaShop's Configuration store and edited from the module's configuration screen (Modules → Redsys for PrestaShop → Configure). Read values in code with PrestaShop's standard API:
// Read a stored Redsys configuration value (key names are internal to the module).
$merchantCode = Configuration::get('REDSYS_MERCHANT_CODE'); // example key
$terminal = Configuration::get('REDSYS_TERMINAL'); // example key
The actionRedsysConfigSave hook fires whenever the configuration is saved, so a companion module can react to credential or terminal changes.
Extending the module
Because there is no remote API, customization happens through the module's dispatched hooks. The module fires 18 hooks across the payment lifecycle, tokens, IPN handling, express checkout, Paygold and payment capabilities — for example actionRedsysBeforePayment, actionRedsysPaymentSuccess, actionRedsysPaymentError, actionRedsysModifyParameters (chainable) and actionRedsysTokenCreated.
See the full list with parameters, return values and code examples in the PrestaShop Redsys hooks reference.
Get full API access
The REST API ships with Redsys for PrestaShop Premium.