Orders pending payment with the RedSys plugin

The RedSys payment gateway (Bankia, Santander, BBVA, La Caixa, Sabadell), has a plugin with a free version for WooCommerce.

This greatly facilitates the integration of POS with dozens of the most popular banks, but there are some occasions when it generates conflicts.

One of the most frequent failures is an HTTP protocol incompatibility: This fault causes that, Although the purchase can be made correctly, the payment process goes smoothly, and the money changes hands as it should when going to the WooCommerce order panel, they appear as the pending payment. When, as we say, the reality is that the payment has been made correctly.

How to Solve POS Problems - Unpaid Orders

How to solve it?

#WordPress address

In our WordPress, we must ensure that in the configuration that appears in Settings -> General, figure the URL of the web under the https protocol.

So if our website is apkvenue.com, Appear as:

WordPress Address (URL): https://apkvenue.com
Site address (URL): https://apkvenue.com

 

#Redirect Plugins

The next step is to disable any plugin that forces the redirection from HTTP to HTTPS. For example, WordPress Force HTTPS

#Editing the htaccess

We must go, via FTP, to the .htaccess file. Located at the root of the domain.

After making the relevant backup, we edit it and add the following code right at the beginning, so that these are the first lines that appear:

# BEGIN SSL y Redsys fix

RewriteEngine On

# Si la cadena de consulta no contiene wc-api=WC_MyRedsys

RewriteCond %{QUERY_STRING} !wc-api=WC_MyRedsys (NC)

# Y la conexión no es HTTPS

RewriteCond %{HTTPS} off

# Redirigimos a la versión con HTTPS

RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} (R=301,L)

# END SSL y Redsys fix

After that, we have to just save and upload the edited version.

#WooCommerce and RedSys configuration

Finally, in WooCommerce -> Finish Purchase, if checked, uncheck the box: «Force secure payment»

How to Solve POS Problems - Unpaid Orders

And in the configuration of Serviced / RedSys, which appears at the top of the WooCommerce configuration of Finish Purchase, WE DO NOT MARK: «HTTPS SNI Compatibility«.

Have you managed to solve your problem? Now help us by sharing this post!