Forums / Addon Payment Modules / Redsýs Payment Module - Spain

Redsýs Payment Module - Spain

Views: 5,993

Results 1 to 7 of 7
3 Mar 2016, 10:56 PM
#1
torvista avatar

torvista

Totally Zenned

Join Date:
Aug 2007
Location:
Gijón, Asturias, Spain
Posts:
2,876
Plugin Contributions:
7

Redsýs Payment Module - Spain

A module for Zen Cart is available from Redsys here
http://www.redsys.es/wps/portal/redsys/publica/areadeserviciosweb/descargaDeDocumentacionYEjecutables

which uses the current SHA256 key requirements.
This is currently at version 2.8.3 and appears to work (in that it does not crash the shop on installation).
But, an amount above 999.99 euros will result in 1 being sent to the gateway so you could say it is buggy.

It is a very basic module but, given the zero presence ZC has in Spain, some credit must be given for Redsys having anything available at all.

I have made a huge number of modifications to this code for both bugs and to provide the user and admin with all the information that the TPV sends to the shop during the purchase process, including a separate admin page listing all the transaction attempts and TPV results failed or not.

I intend to upload this code once ZC1.55 has been released/when I have tested it on ZC1.55/php 7, but in the meantime, if anyone wishes to try out my current code which is tested on a vanilla ZC1.54/php 5.6.8, please pm me (in either language).

Steve
github.com/torvista: BackupMySQL, Structured Data, Multiple Copy-Move-Delete, Google reCaptcha, Image Checker, Spanish Language Pack and more...

2 Aug 2017, 5:06 PM
#2
beto_pu avatar

beto_pu

New Zenner

Join Date:
Apr 2007
Posts:
14
Plugin Contributions:
0

Re: Redsýs Payment Module - Spain

Hi,

I've installed the 1.5.4 version (I think it is the 1.5.4 version) in a 1.5.5. Everything works fine until you get the response from the bank. No order is created. The log shows that the customer session expired and that order number is missing.

Log:

Aug 02 2017 16:40:10 -- redsys_process 77: $postString=
Ds_SignatureVersion=HMAC_SHA256_V1&Ds_MerchantParameters=*************************************************
Aug 02 2017 16:40:10 -- redsys_process 87: $local_dev=FALSE
Aug 02 2017 16:40:10 -- redsys_process 92: $server=https://www.tiendarecambios.es/
Aug 02 2017 16:40:10 -- redsys_process 95: $dest=https://www.tiendarecambios.es/index.php?main_page=checkout_process
Aug 02 2017 16:40:12 -- redsys_process 176:
Expiró el tiempo de sesión : TiendaRecambios.es, Tus recambios las 24h
Inicio ::
Expiró el tiempo de sesión

checkoutSuccessOrderNumber MISSING
Aug 02 2017 16:40:12 -- redsys_process 189: TRANSACTION END

3 Aug 2017, 6:40 AM
#3
torvista avatar

torvista

Totally Zenned

Join Date:
Aug 2007
Location:
Gijón, Asturias, Spain
Posts:
2,876
Plugin Contributions:
7

Re: Redsýs Payment Module - Spain

What version of 1.55 is your shop?

Steve
github.com/torvista: BackupMySQL, Structured Data, Multiple Copy-Move-Delete, Google reCaptcha, Image Checker, Spanish Language Pack and more...

3 Aug 2017, 8:36 AM
#4
torvista avatar

torvista

Totally Zenned

Join Date:
Aug 2007
Location:
Gijón, Asturias, Spain
Posts:
2,876
Plugin Contributions:
7

Re: Redsýs Payment Module - Spain

The logfile shows the POST variables sent by Redsys.

If you separate them out they should be like this:

Ds_SignatureVersion=HMAC_SHA256_V1
&
Ds_MerchantParameters= a string of 588 characters
&
Ds_Signature= a string of 43 characters
&
zenid=a string of 103 characters

The zenid identifies this customer.
"redsys_process.php" sends this data to "checkout_process.php" where the zenid is checked.
If the session has timed out for that zenid/the id is not recognised it will cause the session timeout message.

Steve
github.com/torvista: BackupMySQL, Structured Data, Multiple Copy-Move-Delete, Google reCaptcha, Image Checker, Spanish Language Pack and more...

3 Aug 2017, 2:33 PM
#5
beto_pu avatar

beto_pu

New Zenner

Join Date:
Apr 2007
Posts:
14
Plugin Contributions:
0

Re: Redsýs Payment Module - Spain

torvista:

What version of 1.55 is your shop?

My shop is 1.5.5e

I made another attempt and this is the log:

Aug 03 2017 16:26:48 --

Aug 03 2017 16:26:48 -- TRANSACTION START - checkout_confirmation - fn_process_button
Aug 03 2017 16:26:48 -- Customer: ID=2665, name=Pruebas Pruebas, session_id=46kvm35k85lqjsla8l4ojq7jc3
Aug 03 2017 16:26:48 -- 406: Parameters vars_pay:
Array
(
[DS_MERCHANT_MERCHANTCODE] => 088362795
[DS_MERCHANT_TERMINAL] => 1
[DS_MERCHANT_TRANSACTIONTYPE] => 0
[DS_MERCHANT_AMOUNT] => 1705
[DS_MERCHANT_CURRENCY] => 978
[DS_MERCHANT_ORDER] => 020170000009
[DS_MERCHANT_MERCHANTURL] => https://www.tiendarecambios.es/redsys_process.php
[Ds_Merchant_ProductDescription] => ii051091-LLave+pipa+abierta+9+mm+2065541+%281%29
[Ds_Merchant_Titular] => FINO RECAMBIOS
[DS_MERCHANT_URLOK] => https://www.tiendarecambios.es/index.php?main_page=checkout_success
[DS_MERCHANT_URLKO] => https://www.tiendarecambios.es/index.php?main_page=checkout_payment&payment_error=redsys
[Ds_Merchant_MerchantName] => FINO RECAMBIOS (españa)
[Ds_Merchant_ConsumerLanguage] => 001
[Ds_Merchant_MerchantData] => 46kvm35k85lqjsla8l4ojq7jc3
)

Aug 03 2017 16:28:18 --

Aug 03 2017 16:28:18 -- TRANSACTION START - checkout_confirmation - fn_process_button
Aug 03 2017 16:28:18 -- Customer: ID=2665, name=Pruebas Pruebas, session_id=46kvm35k85lqjsla8l4ojq7jc3
Aug 03 2017 16:28:18 -- 406: Parameters vars_pay:
Array
(
[DS_MERCHANT_MERCHANTCODE] => 088362975
[DS_MERCHANT_TERMINAL] => 1
[DS_MERCHANT_TRANSACTIONTYPE] => 0
[DS_MERCHANT_AMOUNT] => 1705
[DS_MERCHANT_CURRENCY] => 978
[DS_MERCHANT_ORDER] => 020170000010
[DS_MERCHANT_MERCHANTURL] => https://www.tiendarecambios.es/redsys_process.php
[Ds_Merchant_ProductDescription] => ii051091-LLave+pipa+abierta+9+mm+2065541+%281%29
[Ds_Merchant_Titular] => FINO RECAMBIOS
[DS_MERCHANT_URLOK] => https://www.tiendarecambios.es/index.php?main_page=checkout_success
[DS_MERCHANT_URLKO] => https://www.tiendarecambios.es/index.php?main_page=checkout_payment&payment_error=redsys
[Ds_Merchant_MerchantName] => FINO RECAMBIOS (españa)
[Ds_Merchant_ConsumerLanguage] => 001
[Ds_Merchant_MerchantData] => 46kvm35k85lqjsla8l4ojq7jc3
)

Aug 03 2017 16:28:55 -- redsys_process 37: require redsysLibrary.php
Aug 03 2017 16:28:55 -- redsys_process 51: require apiRedsysFinal.php
Aug 03 2017 16:28:55 -- redsys_process 54: about to check the POST
Aug 03 2017 16:28:55 -- redsys_process 64: $_POST['Ds_MerchantParameters']=
eyJEc19EYXRlIjoiMDNcLzA4XC8yMDE3IiwiRHNfSG91ciI6IjE2OjI4IiwiRHNfU2VjdXJlUGF5bWVudCI6IjEiLCJEc19DYXJkX0NvdW50cnkiOiI3MjQiLCJEc19BbW91bnQiOiIxNzA1IiwiRHNfQ3VycmVuY3kiOiI5NzgiLCJEc19PcmRlciI6IjAyMDE3MDAwMDAxMCIsIkRzX01lcmNoYW50Q29kZSI6IjA4ODM2Mjk3NSIsIkRzX1Rlcm1pbmFsIjoiMDAxIiwiRHNfUmVzcG9uc2UiOiIwMDAwIiwiRHNfTWVyY2hhbnREYXRhIjoiNDZrdm0zNWs4NWxxanNsYThsNG9qcTdqYzMiLCJEc19UcmFuc2FjdGlvblR5cGUiOiIwIiwiRHNfQ29uc3VtZXJMYW5ndWFnZSI6IjEiLCJEc19BdXRob3Jpc2F0aW9uQ29kZSI6IjA5NTgwNSIsIkRzX0NhcmRfQnJhbmQiOiIxIn0=
Aug 03 2017 16:28:55 -- redsys_process 67: $dDatos=
{"Ds_Date":"03/08/2017","Ds_Hour":"16:28","Ds_SecurePayment":"1","Ds_Card_Country":"724","Ds_Amount":"1705","Ds_Currency":"978","Ds_Order":"020170000010","Ds_MerchantCode":"088362975","Ds_Terminal":"001","Ds_Response":"0000","Ds_MerchantData":"46kvm35k85lqjsla8l4ojq7jc3","Ds_TransactionType":"0","Ds_ConsumerLanguage":"1","Ds_AuthorisationCode":"095805","Ds_Card_Brand":"1"}
Aug 03 2017 16:28:55 -- redsys_process 70: $vars_pay=Array
(
[Ds_Date] => 03/08/2017
[Ds_Hour] => 16:28
[Ds_SecurePayment] => 1
[Ds_Card_Country] => 724
[Ds_Amount] => 1705
[Ds_Currency] => 978
[Ds_Order] => 020170000010
[Ds_MerchantCode] => 088362975
[Ds_Terminal] => 001
[Ds_Response] => 0000
[Ds_MerchantData] => 46kvm35k85lqjsla8l4ojq7jc3
[Ds_TransactionType] => 0
[Ds_ConsumerLanguage] => 1
[Ds_AuthorisationCode] => 095805
[Ds_Card_Brand] => 1
)

Aug 03 2017 16:28:55 -- redsys_process 77: $postString=
Ds_SignatureVersion=HMAC_SHA256_V1&Ds_MerchantParameters=eyJEc19EYXRlIjoiMDNcLzA4XC8yMDE3IiwiRHNfSG91ciI6IjE2OjI4IiwiRHNfU2VjdXJlUGF5bWVudCI6IjEiLCJEc19DYXJkX0NvdW50cnkiOiI3MjQiLCJEc19BbW91bnQiOiIxNzA1IiwiRHNfQ3VycmVuY3kiOiI5NzgiLCJEc19PcmRlciI6IjAyMDE3MDAwMDAxMCIsIkRzX01lcmNoYW50Q29kZSI6IjA4ODM2Mjk3NSIsIkRzX1Rlcm1pbmFsIjoiMDAxIiwiRHNfUmVzcG9uc2UiOiIwMDAwIiwiRHNfTWVyY2hhbnREYXRhIjoiNDZrdm0zNWs4NWxxanNsYThsNG9qcTdqYzMiLCJEc19UcmFuc2FjdGlvblR5cGUiOiIwIiwiRHNfQ29uc3VtZXJMYW5ndWFnZSI6IjEiLCJEc19BdXRob3Jpc2F0aW9uQ29kZSI6IjA5NTgwNSIsIkRzX0NhcmRfQnJhbmQiOiIxIn0=&Ds_Signature=OiV1GCMOIwXWrEfbzuAisDU2xTQSUXpR7v-cFJQQQ6o=&zenid=46kvm35k85lqjsla8l4ojq7jc3
Aug 03 2017 16:28:55 -- redsys_process 87: $local_dev=FALSE
Aug 03 2017 16:28:55 -- redsys_process 92: $server=https://www.tiendarecambios.es/
Aug 03 2017 16:28:55 -- redsys_process 95: $dest=https://www.tiendarecambios.es/index.php?main_page=checkout_process
Aug 03 2017 16:28:55 -- redsys_process 176:
Expiró el tiempo de sesión : TiendaRecambios.es, Tus recambios las 24h
Inicio ::
Expiró el tiempo de sesión

checkoutSuccessOrderNumber MISSING
Aug 03 2017 16:28:55 -- redsys_process 189: TRANSACTION END

No idea why session expires...

3 Aug 2017, 7:23 PM
#6
torvista avatar

torvista

Totally Zenned

Join Date:
Aug 2007
Location:
Gijón, Asturias, Spain
Posts:
2,876
Plugin Contributions:
7

Re: Redsýs Payment Module - Spain

This is my Redsys config:

Attachment 17197

Steve
github.com/torvista: BackupMySQL, Structured Data, Multiple Copy-Move-Delete, Google reCaptcha, Image Checker, Spanish Language Pack and more...

6 Jul 2026, 9:32 AM
#7
torvista avatar

torvista

Totally Zenned

Join Date:
Aug 2007
Location:
Gijón, Asturias, Spain
Posts:
2,876
Plugin Contributions:
7

Re: Redsýs Payment Module - Spain

Note that the module from Redsys has been broken forever, don't even bother to download it.

As further changes are required for Zen Cart 3 and I'm not bothering to document/Github the module, please contact me by PM if you want a copy.

Steve
github.com/torvista: BackupMySQL, Structured Data, Multiple Copy-Move-Delete, Google reCaptcha, Image Checker, Spanish Language Pack and more...