Page 4 of 4 FirstFirst ... 234
Results 31 to 36 of 36
  1. #31
    Join Date
    Jun 2005
    Location
    Kelowna, BC Canada
    Posts
    1,075
    Plugin Contributions
    6

    Default Re: Specific notifier question - experts please!

    Well, this isn't as easy as I hoped it might be... I've not really been able to get anywhere.

    The major problem is with testing! I get no errors... just nothing happens. I would have thought that when the IPN calls my php files that if there is a php error it would show up in the logs, but even when I deliberately create an error (put in an extra { or whatever) and do a PP transaction, I never see an error... just the order never completes. The payment does though.

    Maybe if you guys are going to add init_system functionality to the IPN code in the future I won't worry about it... maybe I'll just hardcode my functions into the IPN function and deal with it every time theres an update.

    - Steven

  2. #32
    Join Date
    Jun 2005
    Location
    Kelowna, BC Canada
    Posts
    1,075
    Plugin Contributions
    6

    Default Re: Specific notifier question - experts please!

    Ok, I found a "solution". As described above, I ditched the idea of doing it properly (integrating observer functionality into ipn_application_top.php) and just hardcoded it. I'm going to write my solution here in case it helps someone trying to do something similar, or perhaps helps someone tell me how I can do it better.

    in my particular case, I was tapping into the notifier: NOTIFY_CHECKOUT_PROCESS_AFTER_ORDER_CREATE_ADD_PRODUCTS that occurs in checkout_process.php immediately after these lines
    Code:
    $order->create_add_products($insert_id);
    $_SESSION['order_number_created'] = $insert_id;
    The first line also occurs in ipn_main_handler.php so I simply added these lines immediately after
    Code:
    //begin: stockManger
    	$_SESSION['order_number_created'] = $insert_id;
    	require(DIR_WS_CLASSES . 'observers/class.stockManager.php');
    	$stockManager = new stockManager();
    	$stockManager->update($this, 'NOTIFY_CHECKOUT_PROCESS_AFTER_ORDER_CREATE_ADD_PRODUCTS');
    //end: stockManager
    which essentially does what the observer/auto loader functionality does... only simpler and with no flexibility (hardcoded). I put in the first line there because the stockManager observer class that I created relied on that session variable.


    Obviously, it would just be better to have the notifier/observer functionality present in the IPN processing so that contribs don't have to worry about any of this... but until then, anyone trying to make an observer that occurs after an order is completed (and uses PayPal)... this may help you solve the PayPal problem.

    - Steven

  3. #33
    Join Date
    Feb 2007
    Posts
    4
    Plugin Contributions
    0

    Default Re: Specific notifier question - experts please!

    I have been reading this thread and others.
    I haven't tried a solution similar to s_mack's last post yet, but I am starting to wonder if it is all a bit too hard for the paypal/zen cart system at this stage.
    Question: If I wanted to deliver virtual products (eg, add credit to mobile phone account) ONLY after the payment has been cleared / completed, using Paypal IPN, is it possible and is it reliable?
    Any ideas on how it could be done?

  4. #34
    Join Date
    Jun 2005
    Location
    Kelowna, BC Canada
    Posts
    1,075
    Plugin Contributions
    6

    Default Re: Specific notifier question - experts please!

    "yes" and "probably"... using the same method I did as your basis.

    - Steven

  5. #35
    Join Date
    Jun 2005
    Location
    Kelowna, BC Canada
    Posts
    1,075
    Plugin Contributions
    6

    Default Re: Specific notifier question - experts please!

    Also, just a quick update on the success of the solution I came up with above.

    It works great! I haven't had a single issue since! Whether the order is from PayPal or not, the notifier now works as expected and the code is executed. Yes, its a bit of a hack - but it works.

    A bonus is... while my code will become obsolete when/if Zen adds notifier support to the IPN code... it should just be a matter of me deleting the code I introduced! Or rather... I can just upgrade the IPN file without worrying about destroying my functionality because it should work in the exact same way. Of course, any updates Zen puts out BEFORE the notifier system is extended WILL destroy my code :) so I have to be careful.

    Cheers!

    - Steven

  6. #36
    Join Date
    Feb 2007
    Posts
    4
    Plugin Contributions
    0

    Default Re: Specific notifier question - experts please!

    Thanks for the update.
    As sugested I just hacked the ipn_main_handler file to check for payment status completed.
    Haven't had full testing but looks to work well.
    This Zen Cart really is an excellent product.

 

 
Page 4 of 4 FirstFirst ... 234

Similar Threads

  1. Notifier question
    By hubert in forum Code Collaboration
    Replies: 19
    Last Post: 8 Feb 2016, 12:42 AM
  2. v151 Notifier help please
    By slobadog in forum General Questions
    Replies: 12
    Last Post: 7 Mar 2013, 11:14 AM
  3. zone specific flat rate shipping question
    By Lockerroom in forum Built-in Shipping and Payment Modules
    Replies: 0
    Last Post: 7 Jan 2010, 07:21 PM
  4. Shipping question for Zen Experts????????
    By pegog in forum Built-in Shipping and Payment Modules
    Replies: 5
    Last Post: 21 Jun 2008, 03:32 PM

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