Results 1 to 8 of 8
  1. #1
    Join Date
    Aug 2007
    Location
    Gijón, Asturias, Spain
    Posts
    2,826
    Plugin Contributions
    31

    Default Problem with 4b payment module

    Sorry to post a woolly question but here goes.

    I am in the final stages of my 1.5 upgrade and can't get this payment module to work. I have no other issues.

    I have old and new shops (tienda_139 and tienda_15) on the same local server

    When I confirm the order and I get transferred to the gateway, I get the payment page displayed correctly with the 139 shop and an error with the 1.5 shop.
    The 4b gateway is archaic rubbish, I can't get any error messages from it.
    The payment module code is the same in both shops, I have tried the order.php from 139 and the database details are identical for this module.

    I just wanted to know if there is anything new in the 1.5 code relating to payment modules that may impinge on old code.
    thanks
    Steve
    Steve
    github.com/torvista: BackupMySQL, Structured Data, Multiple Copy-Move-Delete, Google reCaptcha, Image Checker, Spanish Language Pack and more...

  2. #2
    Join Date
    Jan 2004
    Posts
    66,443
    Plugin Contributions
    279

    Default Re: Problem with 4b payment module

    Quote Originally Posted by torvista View Post
    I just wanted to know if there is anything new in the 1.5 code relating to payment modules that may impinge on old code.
    Can't think of anything related to payment modules that would have any such impact.
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  3. #3
    Join Date
    Aug 2007
    Location
    Gijón, Asturias, Spain
    Posts
    2,826
    Plugin Contributions
    31

    Default Re: Problem with 4b payment module

    ok, thanks for the quick response..I'll go back to staring at Beyond Compare then
    Steve
    github.com/torvista: BackupMySQL, Structured Data, Multiple Copy-Move-Delete, Google reCaptcha, Image Checker, Spanish Language Pack and more...

  4. #4
    Join Date
    Aug 2007
    Location
    Gijón, Asturias, Spain
    Posts
    2,826
    Plugin Contributions
    31

    Default Re: Problem with 4b payment module

    After breakfast, lunch and dinner of red herrings, I find the problem in the http headers.

    The initial string sent to the gateway is composed of the order reference, the business number and the language, strictly in that order.

    In 1.5 a security token is prefixed somewhere after the return of $process_button_string from the payment module. This causes the gateway to not recognise the business number/name.

    In the module, echoing htmlentities($process_button_string) just before the return yields:
    <input type="hidden" name="referencia" value="38" /><input type="hidden" name="ccomercio" value="XXXXX" /><input type="hidden" name="idioma" value="en" />
    Live HTTP headers shows this data being passed to the gateway:

    1.39
    referencia=5&ccomercio=XXXXXX&idioma=en

    1.5
    securityToken=098edf2901a446fd9baf5e1221e26316&referencia=38&ccomercio=XXXXXX&id ioma=en

    I've looked further into this but its not obvious enough for me to see where this gets added....
    Steve
    github.com/torvista: BackupMySQL, Structured Data, Multiple Copy-Move-Delete, Google reCaptcha, Image Checker, Spanish Language Pack and more...

  5. #5
    Join Date
    Aug 2007
    Location
    Gijón, Asturias, Spain
    Posts
    2,826
    Plugin Contributions
    31

    Default security token in form with post

    Ok, there is a new line in 1.5 html_output.php that adds a security token for forms using post.

    PHP Code:
     *  Output a form
     
    */
      function 
    zen_draw_form($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;
      } 
    In tp_checkout_confirmation_default.php we have the button/form creation:
    PHP Code:
    <?php
      
    echo zen_draw_form('checkout_confirmation'$form_action_url'post''id="checkout_confirmation" onsubmit="submitonce();"');

      if (
    is_array($payment_modules->modules)) {
        echo 
    $payment_modules->process_button();
      }
    ?>
    So the token is being added here.

    While I can hack this for this one payment module, I am more interested in how it should be done properly.

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

  6. #6
    Join Date
    Jan 2004
    Posts
    66,443
    Plugin Contributions
    279

    Default Re: security token in form with post

    Since your payment gateway is incapable of accepting user-submitted parameters, for your unique payment module's requirements, you'll need to hack your checkout-confirmation template file and draw your own form instead of using zen_draw_form(). Be aware that any alterations you make to checkout files/templates/logic/code have a direct impact on your PCI validation.
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  7. #7
    Join Date
    Aug 2007
    Location
    Gijón, Asturias, Spain
    Posts
    2,826
    Plugin Contributions
    31

    Default 4b payment module and PCI-DSS

    Ha! No surprises there, PCI is still unknown by most businesses here in Spain.

    4b is one of the only three card/atm networks and (in my experience) seem to be coasting along with code, documentation, support and attitude from twenty years ago.

    Just to round off, for interest, what do you mean by "user-submitted parameters" as opposed to how it works now?

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

  8. #8
    Join Date
    Jan 2004
    Posts
    66,443
    Plugin Contributions
    279

    Default Re: 4b payment module and PCI-DSS

    By "user-submitted" I was referring to "extra" or "unexpected" parameters that their system doesn't recognize or do anything with. Most modern gateways allow you to pass many additional fields, which they often pass back to you when they complete the transaction and send the customer back.
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

 

 

Similar Threads

  1. Problem with payment Module
    By alexipr in forum Addon Payment Modules
    Replies: 1
    Last Post: 9 Dec 2009, 11:17 PM
  2. Problem with Protx payment module.
    By ugorg in forum Addon Payment Modules
    Replies: 0
    Last Post: 16 Feb 2009, 08:24 PM
  3. Problem with Payment Module
    By artistwantab in forum Built-in Shipping and Payment Modules
    Replies: 1
    Last Post: 16 Nov 2008, 05:04 AM
  4. CC Payment Module - Problem with cc.php ?
    By bdekraker in forum Built-in Shipping and Payment Modules
    Replies: 3
    Last Post: 15 Dec 2007, 04:49 PM
  5. Problem with Sage Payment module.
    By kedar_purohit in forum Built-in Shipping and Payment Modules
    Replies: 0
    Last Post: 10 Aug 2007, 04:30 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg