Results 1 to 2 of 2

Threaded View

  1. #1
    Join Date
    Jun 2005
    Posts
    11
    Plugin Contributions
    0

    Default AuthorizeNet_AIM emulator/eprocessingnetwork observer plugin problem

    PHP 8.2 if that matters. USPS plugin installed.

    I just upgraded to 2.0.1 so I thought I would try to reset the credit card processor and do it the right way, as I've had a variety of plugins over the years. I removed all old plugins (ceon, etc) and so just have the base authorizenet_aim plugin activated and configured.

    Following directions from a comment within the plugin, it directed me to create an observer:
    Code:
    +++ includes/classes/observers/auto.authorizenet_aim.php
    <?php
    // An auto-loaded observer that enables switching processor to eprocessingnetwork
    class zcObserverAuthorizenetAim extends base{
      public function __construct(){
        $this->attach($this, array('NOTIFY_PAYMENT_AUTHNET_MODE_SELECTION'));
      }
    
      public function update(&$class, $eventID, $mode, &$p2, &$p3, &$p4, &$p5, &$p6, &$p7){
        error_log(print_r($class, true) . "\neventid".print_r($eventID, true). "\np2:".print_r($p2, true)."\nmode:".print_r($mode, true));
    
        if($eventID != "NOTIFY_PAYMENT_AUTHNET_MODE_SELECTION")
          return;
        
        if($mode == "AIM")
            $mode = "eProcessing";
      }
    }

    The problem is that the $mode parameter is read-only (even if I add an &) and the $class->mode variable is private, so the comment in the authorizenet_aim module appears to be incorrect.

    I can get it to work if I modify the core code directly:
    Code:
    Index: includes/modules/payment/authorizenet_aim.php
    ===================================================================
    --- includes/modules/payment/authorizenet_aim.php    (revision 30655)
    +++ includes/modules/payment/authorizenet_aim.php    (working copy)
    @@ -619,9 +619,9 @@
         }
     
         // set URL
    -    $this->mode = 'AIM';
    +    $this->mode = 'eProcessing';
    $this->notify('NOTIFY_PAYMENT_AUTHNET_MODE_SELECTION', $this->mode, $submit_data);
    But, it would be nice for the notify trigger to work correctly. I don't know if the right answer is to make the mode variable public or to pass in the parameter to the notify() as a second/third parameter so then it can be edited (and if that method is done) then the switch($this->mode) below would need to be changed as well.
    Last edited by jondaley; 27 Sep 2024 at 12:23 PM. Reason: turned on advanced editor for formatting.

 

 

Similar Threads

  1. eProcessing Network - emulator problem
    By Darren Cubi in forum Addon Payment Modules
    Replies: 9
    Last Post: 8 Feb 2013, 09:51 PM
  2. Eprocessingnetwork issues
    By mysh in forum Addon Payment Modules
    Replies: 4
    Last Post: 29 Mar 2012, 08:21 PM
  3. Notifier/Observer problem editing Real World Example 1
    By dale88 in forum Templates, Stylesheets, Page Layout
    Replies: 23
    Last Post: 12 Mar 2010, 02:03 AM
  4. authorizenet_aim problem with test mode & CC#
    By Beau91324 in forum General Questions
    Replies: 2
    Last Post: 4 Mar 2010, 03:43 PM
  5. Authorize.net Emulator problem
    By rossi in forum General Questions
    Replies: 3
    Last Post: 25 Apr 2009, 06:42 AM

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