Forums / Addon Payment Modules / 4b (Spain) payment gateway, Pasarela de pago 4b

4b (Spain) payment gateway, Pasarela de pago 4b

Views: 4,539

Results 1 to 11 of 11
21 May 2011, 9:07 AM
#1
torvista avatar

torvista

Totally Zenned

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

4b (Spain) payment gateway, Pasarela de pago 4b

There is a contribution in the downloads titled "Pasarela de Pago 4b" by ZhenIT software.
http://www.zen-cart.com/index.php?main_page=product_contrib_info&products_id=418
This is V1.0 and seems unsupported (questions unanswered) on the authors site.

It has one fatal flaw which many people have found, resulting in the gateway returning the error message

URL de cesta errónea

Compruebe si la URL donde reside la cesta es correcta y si ésta funciona correctamente

No se encuentra la URL de la cestaThis debug error is noted:
[20-May-2011 23:13:19] PHP Catchable fatal error: Object of class order could not be converted to string in xxxxxx/includes/modules/payment/Qb_ZhenIT.php on line 280This can be avoided by commenting out the offending line
$this->trace("total del pedido: $total objeto: $pedido .\nserie: ". $pedido_s);This is only used to pass info to the debug log and is not needed for the transaction.

The multilanguage aspect is not working (to enable the gateway to display in the customers browser language), and commented out.
I have fixed this, if anyone wants a copy pm me.

At some point when I have given up fiddling with it, I'll upload an update, but don't hold your breath.

Otherwise this contribution works.
Which is more than can be said for the 4b technical documentation....which is just plain wrong.

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

17 Jan 2012, 4:09 PM
#2
torvista avatar

torvista

Totally Zenned

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

Re: 4b (Spain) payment gateway, Pasarela de pago 4b

Problem Upgrading to 1.5:

In templates\tpl_checkout_confirmation_default.php
when the user clicks the Confirm Payment button, form data is sent to 4b:
1.39 sends
referencia=5&ccomercio=XXXXXX&idioma=en
but
1.5 sends
securityToken=098edf2901a446fd9baf5e1221e26316&referencia=38&ccomercio=XXXXXX&idioma=en

The zen_draw_form function now has a security key added to the form generation.
4b expects the referencia, ccomercio and idioma fields strictly as the first, second and third fields so the inclusion of the key as the first field breaks this and causes "ERROR" to be displayed in the gateway (with no error message of course).

So, this particular form generation for this particular module needs to not include the security key.
I created a new function zen_draw_form_4b in function/extra_functions
```php
/*

  • Output a form for 4b in checkout confirmation only, to not use the security token. Copied from html_output
    */
    function zen_draw_form_4b($name, $action, $method = 'post', $parameters = '') {
    $form = '<form name="' . zen_output_string($name) . '" action="' . zen_output_string($action) . '" method="' . zen_output_string($method) . '"';

    if (zen_not_null($parameters)) $form .= ' ' . $parameters;

    $form .= '>';
    //if (strtolower($method) == 'post') $form .= '<input type="hidden" name="securityToken" value="' . $_SESSION['securityToken'] . '" />';
    return $form;
    }

   Change
     ```php
echo zen_draw_form('checkout_confirmation', $form_action_url, 'post', 'id="checkout_confirmation" onsubmit="submitonce();"');
```   to
   
  ```php
if ($_POST[payment]== 'Qb_ZhenIT') {// to send form minus security token to 4b
                  echo zen_draw_form_4b('checkout_confirmation', $form_action_url, 'post', 'id="checkout_confirmation" onsubmit="submitonce();"');
                  } else {
                  echo zen_draw_form('checkout_confirmation', $form_action_url, 'post', 'id="checkout_confirmation" onsubmit="submitonce();"');            
                  }
   
```  I have tidied-up this module quite a bit but due to lack of interest in Zen Cart in Spain, tidying it up for public consumption, documenting and uploading a new version is not on my to-do list at the moment.
  If anyone wants a copy please pm me.

  Note that the "updated version" available from the original authors site uses code for OScommerce with a compatibility/translation file for Zen Cart functions.
  I can't say if it works or not on a default installation (1.39) as the code was so ugly to my eyes I couldn't bear to mix it with my cart!

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

16 Mar 2012, 11:33 AM
#3
garchi avatar

garchi

New Zenner

Join Date:
Apr 2011
Location:
Zaragoza, españa
Posts:
8
Plugin Contributions:
0

Re: 4b (Spain) payment gateway, Pasarela de pago 4b

You can send a corrected copy of version 1.3.9
I work the multilingual module
Regards

16 Mar 2012, 12:33 PM
#4
torvista avatar

torvista

Totally Zenned

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

Re: 4b (Spain) payment gateway, Pasarela de pago 4b

Aqui puedes escribir en español, ¡no te entiendo muy bien!

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

16 Mar 2012, 12:51 PM
#5
garchi avatar

garchi

New Zenner

Join Date:
Apr 2011
Location:
Zaragoza, españa
Posts:
8
Plugin Contributions:
0

Re: 4b (Spain) payment gateway, Pasarela de pago 4b

Tienes una copia para la version 1.3.9 ??
No me funciona el modulo multilingue.
gracias

16 Mar 2012, 1:39 PM
#6
torvista avatar

torvista

Totally Zenned

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

Re: 4b (Spain) payment gateway, Pasarela de pago 4b

Acabo de enviar mi archivos (muy customizados) a otro Zenner para probar, no tengo noticias todavia...cuando lo tengo, voy a subirlo como una contribucion para todos.

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

16 Mar 2012, 3:37 PM
#7
garchi avatar

garchi

New Zenner

Join Date:
Apr 2011
Location:
Zaragoza, españa
Posts:
8
Plugin Contributions:
0

Re: 4b (Spain) payment gateway, Pasarela de pago 4b

ok, gracias

29 May 2012, 10:37 PM
#8
torvista avatar

torvista

Totally Zenned

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

Re: 4b (Spain) payment gateway, Pasarela de pago 4b

ZC1.5

I think this happens when
the payment is first declined in the gateway,
then the user presses continue (which takes them back to the shop instead of trying again),
they get an error message in the shop,
they press back in the browser to go back to the gateway,
they try and pay again,
it succeeds then they return to the shop and the order is recorded as paid but as Gift Voucher. There may be other backs and forwards involved as this error has only happened twice in six months.

I don't have the Gift vouchers or discount coupons enabled in my shop.

My question is, to the people in the know, has anything been seen like this before in other other sloppy payment modules, where should I be looking at in the module to plug this hole, and from which built-in module should I best examine to copy the procedure to avoid this.

thanks
Steve

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

5 Jun 2012, 2:54 PM
#9
pazaz avatar

pazaz

New Zenner

Join Date:
May 2007
Posts:
47
Plugin Contributions:
0

Re: 4b (Spain) payment gateway, Pasarela de pago 4b

Hi Torvista

I am in valencia and use both zencart 1.39 and 1.5 shops but have been talking with my bank banco popular and they say that they can set something up with pasarela de pago 4b. Can you send my a copy of what you have that I can test with my bank.

rgds
Mick

5 Jun 2012, 2:59 PM
#10
torvista avatar

torvista

Totally Zenned

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

Re: 4b (Spain) payment gateway, Pasarela de pago 4b

reply by pm

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

7 Jun 2012, 9:53 AM
#11
torvista avatar

torvista

Totally Zenned

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

Re: 4b (Spain) payment gateway, Pasarela de pago 4b

I have a version available for testing, for which I would like feedback before I upload it.

...the two people who have already had this version have not bothered to tell me anything yet.

send me your email by pm.

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