Developer Portal

Redsys for PrestaShop API

14 specialized services, 28 controllers, and a complete integration surface for PrestaShop developers.

PrestaShop 8+ · PHP 8.1+ Hooks reference View plugin

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:

Module link pattern
# 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.

ControllerRole
paymentInitiates the payment and redirects the shopper to Redsys
validationValidates payment data for InSite and other embedded methods
ipnReceives the signed Instant Payment Notification from Redsys (server-to-server)
confirmationHandles the successful return from Redsys (can settle via IPN or URL params)
returnHandles failed / cancelled returns from Redsys
paygoldipnIPN endpoint for Paygold payment links
savedcardpayment / oneclickpaymentPayment with a stored card / one-click checkout
bizumpayment / insitepaymentBizum and InSite (embedded card) payment entry points
expresspay / googlepaycheckoutpayment / applepaycheckoutpaymentExpress checkout (Apple Pay, Google Pay, one-click) handlers
cronScheduled 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.

Notification URL
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.

ServiceResponsibility
RedsysRefundServiceExecutes full and partial refunds against Redsys
TokenManagementServiceStores, lists and deletes saved-card tokens
PreauthorizationServicePre-authorization and later capture
PaygoldServicePaygold payment-link generation
ExpressCheckoutService / ApplePayService / GooglePayService / OneClickServiceExpress and wallet checkout flows
RedsysOrderNumberServiceBuilds and parses the Redsys order number (Ds_Merchant_Order)
RedsysRestService / InespayApiServiceClients for the Redsys and Inespay REST APIs
PaymentFilterServiceControls which payment methods are offered
LogManagementService / LicenseServiceLogging 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.

ControllerPurpose
AdminRedsysLogsControllerBrowse and export the gateway transaction logs
AdminRedsysTokensControllerManage stored card tokens
AdminRedsysPaygoldControllerCreate and track Paygold payment links
AdminRedsysLicenseControllerActivate 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:

PHP — example
// 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.