Results 1 to 2 of 2
  1. #1
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    13,410
    Plugin Contributions
    94

    Default [Done 155b] collectsCardDataOnsite: payment-class not creating correctly-named fields

    When a payment method (e.g. authorizenet_aim) collects card data onsite, there is supposed to be a hidden variable created for that payment method so that the jQuery running on the checkout_payment page "knows" this condition.

    The processing that's supposed to insert that field is the selection function of /includes/classes/payment.php, but the hidden-input's name is winding up as _collects_onsite instead of (for example) authorizenet_aim_collects_onsite.

    The issue is that that function's using the wrong variable name to create that/those hidden variables. The function needs to be changed from:
    Code:
      function selection() {
        $selection_array = array();
        if (is_array($this->modules)) {
          reset($this->modules);
          while (list(, $value) = each($this->modules)) {
            $class = substr($value, 0, strrpos($value, '.'));
            if ($GLOBALS[$class]->enabled) {
              $selection = $GLOBALS[$class]->selection();
              if (isset($GLOBALS[$class]->collectsCardDataOnsite) && $GLOBALS[$class]->collectsCardDataOnsite == true) {
                $selection['fields'][] = array('title' => '',
                                             'field' => zen_draw_hidden_field($this->code . '_collects_onsite', 'true', 'id="' . $this->code. '_collects_onsite"'),
                                             'tag' => '');
    
              }
              if (is_array($selection)) $selection_array[] = $selection;
            }
          }
        }
        return $selection_array;
      }
    to
    Code:
      function selection() {
        $selection_array = array();
        if (is_array($this->modules)) {
          reset($this->modules);
          while (list(, $value) = each($this->modules)) {
            $class = substr($value, 0, strrpos($value, '.'));
            if ($GLOBALS[$class]->enabled) {
              $selection = $GLOBALS[$class]->selection();
              if (isset($GLOBALS[$class]->collectsCardDataOnsite) && $GLOBALS[$class]->collectsCardDataOnsite == true) {
                $selection['fields'][] = array('title' => '',
                                             'field' => zen_draw_hidden_field($class . '_collects_onsite', 'true', 'id="' . $class. '_collects_onsite"'),
                                             'tag' => '');
    
              }
              if (is_array($selection)) $selection_array[] = $selection;
            }
          }
        }
        return $selection_array;
      }

  2. #2
    Join Date
    Jan 2004
    Posts
    66,419
    Blog Entries
    7
    Plugin Contributions
    81

    Default Re: [Done 155b] collectsCardDataOnsite: payment-class not creating correctly-named fi

    .

    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. Replies: 102
    Last Post: 1 Jun 2017, 09:29 AM
  2. How to configure 1 oz weight on item not showing USPS first class cost correctly?
    By cahoca in forum Built-in Shipping and Payment Modules
    Replies: 13
    Last Post: 22 Jul 2011, 03:32 PM
  3. Replies: 8
    Last Post: 27 Apr 2010, 07:19 PM
  4. Replies: 7
    Last Post: 4 Nov 2009, 10:49 PM
  5. Replies: 0
    Last Post: 17 Nov 2007, 06:32 PM

Bookmarks

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
Zen-Cart, Internet Selling Services, Klamath Falls, OR