Results 1 to 10 of 25

Hybrid View

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

    Default Re: How do I test paypal??

    Ok, so I almost got my paypal testing setup.

    Set up the Sandbox accounts; changed my paypal IPN module to point at sandbox; configured my computer so outside world can see it; got a domain name and set up the IPN return URL to the proper setting....

    Everything works, except for some reason when I finish a PayPal order, it does't set the status to 'processing' like it should (and does on my live server). Just leaves it as 'pending'. Any thoughts?

    - Steven

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

    Default Re: How do I test paypal??

    What is the URL to your test server ?
    What is the URL that your IPN's are being returned to?
    Can it be accessed from outside your router?
    If not, you'll not get the updates.

    If you turn on the debug logging, do you get any results in the logs ?
    .

    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 2005
    Location
    Kelowna, BC Canada
    Posts
    1,075
    Plugin Contributions
    6

    Default Re: How do I test paypal??

    Quote Originally Posted by DrByte
    What is the URL to your test server ?
    http://dab.criticalnode.com/shop/
    What is the URL that your IPN's are being returned to?
    http://dab.criticalnode.com/shop/ipn_main_handler.php
    Can it be accessed from outside your router?
    Should be?!?
    If you turn on the debug logging, do you get any results in the logs ?
    I'll give that a try.

    - Steven

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

    Default Re: How do I test paypal??

    yes I do... not that they mean anything to me :) But yes, I do get a 5k log file that I'm not sure is safe to post the contents of.

    Please don't put any more effort into this Dr.B. I have bigger fish to fry right now anyway. Thank you for your help.

    - Steven

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

    Default Re: How do I test paypal??

    Ok, I'm back asking for help again :)

    I had a chance to go through that log file, and it seems the problem might be because the IPN is returning an unrecognized txn_type. Looking through the ipn_main_handler.php file I gather that it is expecting a "unique" or "express_checkout" or one of the many other types, none of which are "web_accept" so it gets interpreted as "unknown". Is this my problem?


    Code:
    Jan 07 2007 18:15 -- IPN WARNING:: Could not establish txn type unknown
     postdata=txn_type=web_accept
    Here's the whole file (edited where the info might be sensitive for some reason):
    Code:
    Jan 07 2007 18:15 -- IPN NOTICE::ipn_application_top -> language files okay
    
    Jan 07 2007 18:15 -- IPN INFO - POST VARS received: 
    txn_type=web_accept 
    &payment_date=18:15:25 Jan 07, 2007 PST 
    &last_name=Fakename 
    &residence_country=CA 
    &pending_reason=unilateral 
    &item_name=SmartieParts Purchase 
    &payment_gross= 
    &mc_currency=CAD 
    &[email protected] 
    &payment_type=instant 
    &verify_sign=[removed just in case] 
    &payer_status=unverified 
    &test_ipn=1 
    &tax=0.00 
    &[email protected] 
    &txn_id=0 
    &quantity=1 
    &[email protected] 
    &first_name=Steven 
    &payer_id=[removed just in case] 
    &item_number= 
    &payment_status=Pending 
    &shipping=0.00 
    &mc_gross=38.42 
    &custom=zenid=[removed just in case]  
    &charset=windows-1252 
    &notify_version=2.1 
    &cmd=_notify-validate
    
    Jan 07 2007 18:15 -- IPN INFO - POST VARS sent back: 
    POST /cgi-bin/webscr HTTP/1.1
    Host: www.sandbox.paypal.com
    Content-type: application/x-www-form-urlencoded
    Content-length: 677
    Connection: close
    
    txn_type=web_accept 
    &payment_date=18:15:25 Jan 07, 2007 PST 
    &last_name=Fakename 
    &residence_country=CA 
    &pending_reason=unilateral 
    &item_name=SmartieParts Purchase 
    &payment_gross= 
    &mc_currency=CAD 
    &[email protected] 
    &payment_type=instant 
    &verify_sign=[removed just in case]  
    &payer_status=unverified 
    &test_ipn=1 
    &tax=0.00 
    &[email protected] 
    &txn_id=0 
    &quantity=1 
    &[email protected] 
    &first_name=Steven 
    &payer_id=[removed just in case]  
    &item_number= 
    &payment_status=Pending 
    &shipping=0.00 
    &mc_gross=38.42 
    &custom=zenid=[removed just in case]  
    &charset=windows-1252 
    &notify_version=2.1 
    &cmd=_notify-validate
    
    
    
    Jan 07 2007 18:15 -- IPN INFO - CURL INFO confirmation report 
    HTTP/1.1 200 OK
    ,Date: Mon, 08 Jan 2007 02:15:30 GMT
    ,Server: Apache/1.3.27 (Unix) mod_ssl/2.8.12 OpenSSL/0.9.7a PHP/4.3.2
    ,Set-Cookie: cookie_check=yes; expires=Thu, 05-Jan-2017 02:15:31 GMT; path=/; domain=.paypal.com
    ,Set-Cookie: Apache=24.67.117.185.98631168222530910; path=/; expires=Wed, 31-Dec-36 02:15:30 GMT
    ,Connection: close
    ,Transfer-Encoding: chunked
    ,Content-Type: text/html; charset=UTF-8
    ,
    ,8  
    ,VERIFIED
    ,
    
    Jan 07 2007 18:15 -- Breakpoint: 1
    
    Jan 07 2007 18:15 -- Breakpoint: 2
    
    Jan 07 2007 18:15 -- IPN NOTICE::Processing SANDBOX transaction.
    
    Jan 07 2007 18:15 -- Breakpoint: 3
    
    Jan 07 2007 18:15 -- Breakpoint: 4 txn_type=unknown ordersID = 0 IPN_id=0
    
    Jan 07 2007 18:15 -- IPN DEBUG::uniqueness-test.  Relevant data from POST:
    txn_type = unknown
    parent_txn_id = 
    txn_id = 0
    
    Jan 07 2007 18:15 -- IPN NOTICE::Set transaction type = unknown
    POST data:
    txn_type=web_accept 
    &payment_date=18:15:25 Jan 07, 2007 PST 
    &last_name=Fakename 
    &residence_country=CA 
    &pending_reason=unilateral 
    &item_name=SmartieParts Purchase 
    &payment_gross= 
    &mc_currency=CAD 
    &[email protected] 
    &payment_type=instant 
    &verify_sign=[removed just in case]  
    &payer_status=unverified 
    &test_ipn=1 
    &tax=0.00 
    &[email protected] 
    &txn_id=0 
    &quantity=1 
    &[email protected] 
    &first_name=Steven 
    &payer_id=[removed just in case]  
    &item_number= 
    &payment_status=Pending 
    &shipping=0.00 
    &mc_gross=38.42 
    &custom=zenid=[removed just in case]  
    &charset=windows-1252 
    &notify_version=2.1 
    &cmd=_notify-validate
    
    Jan 07 2007 18:15 -- Breakpoint: 5 txn_type=unknown
    
    Jan 07 2007 18:15 -- IPN WARNING:: Could not establish txn type unknown
     postdata=txn_type=web_accept 
    &payment_date=18:15:25 Jan 07, 2007 PST 
    &last_name=Fakename 
    &residence_country=CA 
    &pending_reason=unilateral 
    &item_name=SmartieParts Purchase 
    &payment_gross= 
    &mc_currency=CAD 
    &[email protected] 
    &payment_type=instant 
    &verify_sign=[removed just in case]  
    &payer_status=unverified 
    &test_ipn=1 
    &tax=0.00 
    &[email protected] 
    &txn_id=0 
    &quantity=1 
    &[email protected] 
    &first_name=Steven 
    &payer_id=[removed just in case]  
    &item_number= 
    &payment_status=Pending 
    &shipping=0.00 
    &mc_gross=38.42 
    &custom=zenid=[removed just in case]  
    &charset=windows-1252 
    &notify_version=2.1 
    &cmd=_notify-validate
    - Steven

  6. #6
    Join Date
    Jan 2004
    Posts
    66,446
    Plugin Contributions
    81

    Default Re: How do I test paypal??

    Actually, in your case, the cause for the IPN not doing anything is that your payment is being held until the PayPal account with the specified email address is created.

    &pending_reason=unilateral
    &[email protected]
    PayPal's "unilateral boarding" means that they'll take the customer's money and hold it for a (short) period to allow you the merchant to actually link the business email address to a real PayPal account, rather than reject the payment because it couldn't find a PayPal account associated with the merchant email address supplied (ie: receiver_email).

    Ideally this should never happen, because you would have a real PayPal account set up to receive the money. Thus the IPN processing engine in Zen Cart is simply treating this as unknown.

    However, once the new account is created, or the email address is linked to a real account, there should be a new IPN notice sent to your site, which will be treated as a "unique" transaction, thereby releasing the order, etc.


    If you wish to have it recognize the unilateral type transactions in logs, try this:

    If you're using v1.3.7, you could locate this code in the paypal_functions.php file:
    Code:
                case 'intl':
                  ipn_debug_email('IPN NOTICE:: Found pending-intl record in database');
                  if ($postArray['payment_status'] == 'Completed') $transType = 'cleared-intl';
                  if ($postArray['payment_status'] == 'Denied')    $transType = 'denied-intl';
                break;
    and add the following immediately below it:
    Code:
                case 'unilateral':
                  ipn_debug_email('IPN NOTICE:: Found record in database.  TRANSACTION IS IN *unilateral* STATUS pending creation of a PayPal account for this receiver_email address.');
                  $transType = 'pending-unilateral';
                break;
    This will at least cause the new status to be recognized when the logs are recording progress.

    Then ... and this may require more testing ... in ipn_main_handler.php you'll see this around line 133:
    Code:
    switch ($txn_type) {
      case 'pending-address':
      case 'pending-intl':
      case 'pending-multicurrency':
      case 'pending-verify':
    add another case immediately after pending-verify:
    Code:
      case 'pending-unilateral':
    This is just a guess, as I haven't tested it.

    Again, it's almost redundant, as until you have actually collected the money, there's no point in the order doing anything ... cuz you haven't been paid.
    Last edited by DrByte; 8 Jan 2007 at 04:36 AM. Reason: updated
    .

    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
    Jun 2005
    Location
    Kelowna, BC Canada
    Posts
    1,075
    Plugin Contributions
    6

    Default Re: How do I test paypal??

    Hmm... ok, but the account is created!

    I changed the email to fakeemail.com just because I didn't want bots surfing through here taking my addy :) The address used was created.

    Hmm... but maybe its because that account was never "verified". I'll try that.

    Thanks for the tips.

    - Steven

 

 

Similar Threads

  1. Newthread for Paypal IPN,i think that is paypal IPN's BUG!!
    By paranoia in forum Built-in Shipping and Payment Modules
    Replies: 3
    Last Post: 22 Apr 2008, 02:37 AM
  2. I'm using PayPal Express and PayPal IPN, should I remove PayPal IPN?
    By tj1 in forum PayPal Express Checkout support
    Replies: 3
    Last Post: 3 Nov 2007, 05:20 AM
  3. How to Test PayPal IPN?
    By MaryK in forum Built-in Shipping and Payment Modules
    Replies: 4
    Last Post: 4 Mar 2007, 11:38 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