Results 1 to 5 of 5

Hybrid View

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

    Default My Website Payments Pro Creates 2 Orders

    Hello all! We have been having problems with Website Payments Pro module since a long time ago, not sure how it started. Basically, when a person orders using Credit Card, I found out that zen cart tries to create 2 orders, 1 from the checkout_process.php file, and one from the ipn_main_handler.php file (data passed from Paypal). The one passed by Paypal will result in an error, because it won't be able to read the customer's session, and will create a fake one. The data being posted by Paypal doesn't include the customer's session ID, so it randomly takes a session from other people. :-/

    So my question is... which of the 2 SHOULD create the order? checkout_process.php or ipn_main_handler.php? I checked my Paypal (normal Paypal/express checkout) module, and it's working fine because a) it passes the customer's session ID to Paypal and Paypal passes it back, and the ipn handler can read the session again, b) the Paypal module's before_process() function has a catch/condition, that is if it detects it came from Paypal, it doesn't create the order and lets the IPN main handler create the order. paypalpd only has this condition if there is an error. If there isn't an error, it continues the checkout_process.php script, hence an order is created.

    I hope you can help me! I just need suggestions on where in paypaldp module to look, or if I should be passing the session ID to paypal.

    Thanks!

  2. #2
    Join Date
    Jan 2004
    Posts
    66,450
    Plugin Contributions
    81

    Default Re: My Website Payments Pro Creates 2 Orders

    The paypaldp module uses the before_process() function to complete the payment, and moves on to the checkout_process module to store the order correctly.

    If you're also getting records from the ipn_main_handler.php for transactions completed with Website Payments Pro, then you've got something damaged in your ipn code.
    It has nothing to do with passing session ID to PayPal.
    The ipn_main_handler should only "create" an order when the transaction was initiated via the Website Payments Standard/IPN module. Otherwise it should only be updating existing transactions if needed.

    Maybe yours is using old code mixed with newer code?
    .
    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
    Jun 2008
    Posts
    11
    Plugin Contributions
    0

    Default Re: My Website Payments Pro Creates 2 Orders

    Quote Originally Posted by DrByte View Post
    Maybe yours is using old code mixed with newer code?
    Thanks DrByte! That makes sense. I imagine the site I manage to be a Frankenstein lol. I got the paypaldp and ipn_main_handler.php from 1.3.8, but my paypal_functions.php file is I think 1.3.5. (not really sure because I got it from somebody else). I got paypaldp to work by copying functions needed from the 1.3.8 version of paypal_functions.php to the paypal_functions.php that we have right now.

    I checked the before_process of paypaldp, traced the cURL and noticed this line:

    $values['NOTIFYURL'] = urlencode(zen_href_link('ipn_main_handler.php', '', 'SSL',false,false,true));

    (under the DoDirectPayment function in paypal_curl.php)

    I think this is the one that tells Paypal to postback the info to our handler. Is this line needed? Also, I'm guessing the catching/order-creation-prevention for paypaldp happens in ipn_main_handler.php?

  4. #4
    Join Date
    Jun 2008
    Posts
    11
    Plugin Contributions
    0

    Default Re: My Website Payments Pro Creates 2 Orders

    The fix I did, which only works in sandbox environment, was to add a checking in the zen_paypal table if that transaction has already been entered, and if it's status is complete. If it is, it gets skipped. When I tested it in the live/real environment, it doesn't work. I think the live server posts back the info to the handler faster than the sandbox.

  5. #5
    Join Date
    Jan 2004
    Posts
    66,450
    Plugin Contributions
    81

    Default Re: My Website Payments Pro Creates 2 Orders

    Quote Originally Posted by jaypee View Post
    I got the paypaldp and ipn_main_handler.php from 1.3.8, but my paypal_functions.php file is I think 1.3.5. (not really sure because I got it from somebody else). I got paypaldp to work by copying functions needed from the 1.3.8 version of paypal_functions.php to the paypal_functions.php that we have right now.
    Why the *bleep* would you do that? Sheesh!
    I'm sorry, hybrid combining of functions/features between versions is not a supported configuration.
    It's hard enough supporting "the last 2 versions" and working on writing a new one, and then people go mixing-and-matching on a whim ... AND you don't even disclose that fact until nothing else makes sense and you're exposed.

    Good luck.
    .
    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. Website Payments pro accept international payments?
    By psr racing in forum PayPal Website Payments Pro support
    Replies: 1
    Last Post: 10 Nov 2009, 03:37 PM
  2. Is PayFlow Pro the same as PayPal Website Payments Pro?
    By alicia1234 in forum PayPal Website Payments Pro support
    Replies: 2
    Last Post: 30 Jan 2009, 10:28 PM
  3. Website Payments Pro
    By Zinfandel in forum PayPal Website Payments Pro support
    Replies: 5
    Last Post: 1 May 2008, 05:00 PM
  4. Website Payments Pro
    By 456Qwer12345 in forum Upgrading from 1.3.x to 1.3.9
    Replies: 1
    Last Post: 14 Feb 2008, 04:58 PM
  5. Website Payments Pro - 1.3.8 Problem
    By bdekraker in forum PayPal Website Payments Pro support
    Replies: 10
    Last Post: 4 Dec 2007, 02:19 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