Forums / Built-in Shipping and Payment Modules / PayPal problem - Order not found

PayPal problem - Order not found

Locked
Results 1 to 14 of 14
This thread is locked. New replies are disabled.
07 Apr 2009, 18:12
#1
plank avatar

plank

New Zenner

Join Date:
Mar 2009
Posts:
8
Plugin Contributions:
0

PayPal problem - Order not found

Hi,

My first customer has ordered a product from my site, and I've got a message from Paypal that I've received the money.

I've also got a message (an array with values) from the store about the Paypal IPN, and all details seems ok.

I've checked out zen_paypal_session table, and found that the session Id mentioned in the debug message is available in that table.

However, I do not see anything in the zen_orders table. The only way right now that I can view what my customer ordered is through the zen_customers_basket table and my server's visitor logs, but that would be a bit of guesswork!

Plus neither me, (and possibly) nor my customer got any email about the order.

Please help!

I'm using v1.3.8.

Here are the Server stats:
Zen Cart 1.3.8a
Database Patch Level: 1.3.8
v1.3.8 [2009-02-20 13:30:01] (Fresh Installation)
v1.3.8 [2009-02-20 13:30:01] (Fresh Installation)

PHP Version: 5.2.8 (Zend: 2.2.0)
Database: MySQL 5.1.30

Thanks
07 Apr 2009, 19:07
#2
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,506
Plugin Contributions:
173

Re: PayPal problem - Order not found

Those are classic symptoms of failed communication from Paypal's server to your server, or failed processing once receiving communications from them.

With whom are you hosted?
What are the contents of the paypal ipn log files?

PayPal troubleshooting: http://www.zen-cart.com/wiki/index.php/PayPal
07 Apr 2009, 19:31
#3
plank avatar

plank

New Zenner

Join Date:
Mar 2009
Posts:
8
Plugin Contributions:
0

Re: PayPal problem - Order not found

Yes... it does look so.

I tried doing a purchase myself, and after the completion, when I was about to return to my site from Paypal, I got an Internal Server Error (500) on the index.php?main_page=checkout_process&referer=paypal... link.

I am hosted with HostGator on a Shared Hosting.

Here are the debug messages:

Apr 07 2009 14:04 -- IPN PROCESSING INITIATED.
*** Originating IP: 66.211.170.66 notify.paypal.com

Apr 07 2009 14:04 -- IPN INFO - POST VARS received (sorted):
Array
(
[business] => payments@... (valid email)
[charset] => windows-1252
[custom] => zenid=1c8da5a2ddb1c0f847b6556081101903
[first_name] => (FirstName)
[handling_amount] => 0.00
[item_name] => Online Shop Purchase
[item_number] => Store Receipt
[last_name] => (LastName)
[mc_currency] => USD
[mc_fee] => 0.47
[mc_gross] => 4.95
[notify_version] => 2.7
[payer_email] => (valid email)
[payer_id] => 4GXJPGNHHMG8S
[payer_status] => verified
[payment_date] => 12:04:27 Apr 07, 2009 PDT
[payment_fee] => 0.47
[payment_gross] => 4.95
[payment_status] => Completed
[payment_type] => instant
[protection_eligibility] => Ineligible
[quantity] => 1
[receiver_email] => payments@... (valid email)
[receiver_id] => QMD43MFAZ7XDY
[residence_country] => IN
[shipping] => 0.00
[tax] => 0.00
[transaction_subject] => zenid=1c8da5a2ddb1c0f847b6556081101903
[txn_id] => 58688655JM752633J
[txn_type] => web_accept
[verify_sign] => ACUe-E7Hjxmeel8FjYAtjnx-yjHAAfrTW-Y-394gJJz2aQD1Kr36.IWH
)


Apr 07 2009 14:04 -- IPN INFO - POST VARS to be sent back for validation:
To: www.paypal.com:80
POST /cgi-bin/webscr HTTP/1.1
Host: www.paypal.com
Content-type: application/x-www-form-urlencoded
Content-length: 855
Connection: close

Array
(
[transaction_subject] => zenid=1c8da5a2ddb1c0f847b6556081101903
[payment_date] => 12:04:27 Apr 07, 2009 PDT
[txn_type] => web_accept
[last_name] => (LastName)
[residence_country] => IN
[item_name] => Online Shop Purchase
[payment_gross] => 4.95
[mc_currency] => USD
[business] => payments@... (valid email)
[payment_type] => instant
[protection_eligibility] => Ineligible
[verify_sign] => ACUe-E7Hjxmeel8FjYAtjnx-yjHAAfrTW-Y-394gJJz2aQD1Kr36.IWH
[payer_status] => verified
[tax] => 0.00
[payer_email] => (valid email)
[txn_id] => 58688655JM752633J
[quantity] => 1
[receiver_email] => payments@... (valid email)
[first_name] => (FirstName)
[payer_id] => 4GXJPGNHHMG8S
[receiver_id] => QMD43MFAZ7XDY
[item_number] => Store Receipt
[handling_amount] => 0.00
[payment_status] => Completed
[payment_fee] => 0.47
[mc_fee] => 0.47
[shipping] => 0.00
[mc_gross] => 4.95
[custom] => zenid=1c8da5a2ddb1c0f847b6556081101903
[charset] => windows-1252
[notify_version] => 2.7
[cmd] => _notify-validate
)


Apr 07 2009 14:04 -- IPN INFO - Confirmation/Validation response
SUCCESS

Apr 07 2009 14:04 -- Breakpoint: 1 - Collected data from PayPal notification

Apr 07 2009 14:04 -- IPN INFO :: Transaction email details.
From IPN = payments@... (valid email) | payments@... (valid email)
From CONFIG = payments@... (valid email)

Apr 07 2009 14:04 -- Breakpoint: 2 - Validated transaction components

Apr 07 2009 14:04 -- Breakpoint: 3 - Communication method verified

Apr 07 2009 14:04 -- IPN NOTICE :: Could not find matched txn_id record in DB. Therefore is new to us.

Apr 07 2009 14:04 -- Breakpoint: 4 - Details: txn_type=unique ordersID = 0 IPN_id=0

Relevant data from POST:
txn_type = unique
parent_txn_id = None
txn_id = 58688655JM752633J

Apr 07 2009 14:04 -- Breakpoint: 5 - Transaction type (txn_type) = unique




Plus, my error_log shows this message (probably the cause for the Internal Server Error?):
[07-Apr-2009 14:04:44] PHP Fatal error: Call to a member function add() on a non-object in /public_html/shop/includes/functions/functions_email.php on line 287
07 Apr 2009, 20:06
#4
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,506
Plugin Contributions:
173

Re: PayPal problem - Order not found

Plank:


Apr 07 2009 14:04 -- Breakpoint: 5 - Transaction type (txn_type) = unique

There should be several steps after that. If it's failing there, then it's not storing the order to the database properly.

Plank:


Plus, my error_log shows this message (probably the cause for the Internal Server Error?):
[QUOTE][07-Apr-2009 14:04:44] PHP Fatal error: Call to a member function add() on a non-object in /public_html/shop/includes/functions/functions_email.php on line 287
[/QUOTE]
No, that would not cause a 500 (Internal Server) error. But it does indicate that it's encountering an email failure.
However, since emails are sent *after* the order data is stored to the orders table, even if the email server rejects the email, you should still see the order in the admin.



To attempt to stop the "fatal" error when the email error occurs, try the following:
Edit /includes/auto_loaders/paypal_ipn.core.php
and add this to the end of the file (and remove the ?> on the last line if it exists in the file):
/**
 * Breakpoint 130.
 *
 * messageStack = new messageStack();
 *
 */
  $autoLoadConfig[130][] = array('autoType'=>'classInstantiate',
                                 'className'=>'messageStack',
                                 'objectName'=>'messageStack');
07 Apr 2009, 20:52
#5
plank avatar

plank

New Zenner

Join Date:
Mar 2009
Posts:
8
Plugin Contributions:
0

Re: PayPal problem - Order not found

That worked wonders!

New orders can be seen in the Admin, and I'm also able to return to the Checkout Success page.

Thanks a lot for helping me out so quickly.
08 Apr 2009, 16:44
#7
plank avatar

plank

New Zenner

Join Date:
Mar 2009
Posts:
8
Plugin Contributions:
0

Re: PayPal problem - Order not found

Good to know that it may help others too.

However, there's still a small problem... no email is being fired from the shop either to me or to the customer. Any workarounds?

And is there any way to manually complete the failed order that I had written about in the first place? I know the item still exists in the customer's cart, but I want to "complete" the order without requiring the customer to again go through the process.
08 Apr 2009, 16:55
#8
plank avatar

plank

New Zenner

Join Date:
Mar 2009
Posts:
8
Plugin Contributions:
0

Re: PayPal problem - Order not found

I'm using PHP as the E-Mail Transport Method and I did get the emails when I had tested by using Direct Bank Deposit module (although that is not being used anymore). I'm getting the IPN debug messages through email though!

(wanted to add this to the above message but was a bit late to edit it)
08 Apr 2009, 22:12
#9
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,506
Plugin Contributions:
173

Re: PayPal problem - Order not found

Plank:


However, there's still a small problem... no email is being fired from the shop either to me or to the customer. Any workarounds?
I'm not surprised, since the errors that were occurring earlier were a result of email problems. I see no obvious reason for there to be any problem with emailing when the PayPal module is sending vs anywhere else in the cart. Unless the email addresses are bad and being rejected, or something like that.


Plank:


And is there any way to manually complete the failed order that I had written about in the first place? I know the item still exists in the customer's cart, but I want to "complete" the order without requiring the customer to again go through the process.

There is much discussion elsewhere about the PayPal Push Orders addon which can be used as a bandage. USE WITH CAUTION.
09 Apr 2009, 17:18
#10
plank avatar

plank

New Zenner

Join Date:
Mar 2009
Posts:
8
Plugin Contributions:
0

Re: PayPal problem - Order not found

DrByte:

Unless the email addresses are bad and being rejected, or something like that.


I don't think so, because I'm getting the IPN debug emails. Do you think if I provide any more information it may help you to detect a possible cause?
10 Apr 2009, 04:55
#11
rleepac avatar

rleepac

New Zenner

Join Date:
Jan 2009
Posts:
44
Plugin Contributions:
0

Re: PayPal problem - Order not found

DrByte:

Those are classic symptoms of failed communication from Paypal's server to your server, or failed processing once receiving communications from them.

With whom are you hosted?
What are the contents of the paypal ipn log files?

PayPal troubleshooting: http://www.zen-cart.com/wiki/index.php/PayPal


I'm having the same problem...Here is from my debug email I received:

Keys for submission: Array
(
[charset] => iso-8859-1
[lc] => US
[page_style] => Primary
[custom] => zenid=25e467bb1d1307a51073fa16f7d417fa
[business] => [email protected]
[return] =>
https://expressmetabolics.com/store/index.php?main_page=checkout_process&referer=paypal
[cancel_return] =>
https://expressmetabolics.com/store/index.php?main_page=checkout_payment
[shopping_url] =>
https://expressmetabolics.com/store/index.php?main_page=shopping_cart
[notify_url] => https://expressmetabolics.com/store/ipn_main_handler.php
[redirect_cmd] => _xclick
[rm] => 2
[bn] => zencart
[mrb] => R-6C7952342H795591R
[pal] => 9E82WJBKKGPLQ
[first_name] => xxxxx
[last_name] => xxxxx
[address1] => xxxx Cxxxxx Road
[city] => Yakima
[state] => WA
[zip] => xxxxx
[country] => US
[email] => [email protected]
[H_PhoneNumber] => xxxxxxxxxx
[night_phone_a] => xxx
[night_phone_b] => xxx
[night_phone_c] => xxxx
[day_phone_a] => xxx
[day_phone_b] => xxx
[day_phone_c] => xxxx
[no_shipping] => 1
[upload] => 1
[currency_code] => USD
[cmd] => _ext-enter
[item_name] => Express Metabolics Purchase
[item_number] => Store Receipt
[amount] => 115.17
[shipping] => 0.00
[tax] => 0.00
[tax_cart] => 0.00
)

How do I fix this??

Thanks!
Bekah
10 Apr 2009, 05:31
#12
rleepac avatar

rleepac

New Zenner

Join Date:
Jan 2009
Posts:
44
Plugin Contributions:
0

Re: PayPal problem - Order not found

Hmmm...I thought I posted this message but I don't see it so I'll try again...

I'm having the same problem. This is one of the debug messages I get from PayPal:

Keys for submission: Array
(
[charset] => iso-8859-1
[lc] => US
[page_style] => Primary
[custom] => zenid=25e467bb1d1307a51073fa16f7d417fa
[business] => [email protected]
[return] =>
https://expressmetabolics.com/store/index.php?main_page=checkout_process&referer=paypal
[cancel_return] =>
https://expressmetabolics.com/store/index.php?main_page=checkout_payment
[shopping_url] =>
https://expressmetabolics.com/store/index.php?main_page=shopping_cart
[notify_url] => https://expressmetabolics.com/store/ipn_main_handler.php
[redirect_cmd] => _xclick
[rm] => 2
[bn] => zencart
[mrb] => R-6C7952342H795591R
[pal] => 9E82WJBKKGPLQ
[country] => US
(I omitted customers info)
[no_shipping] => 1
[upload] => 1
[currency_code] => USD
[cmd] => _ext-enter
[item_name] => Express Metabolics Purchase
[item_number] => Store Receipt
[amount] => 115.17
[shipping] => 0.00
[tax] => 0.00
[tax_cart] => 0.00
)


Then I get another debug message:

IPN INFO - POST VARS to be sent back for validation:
To: http://proxy.shr.secureserver.net:3128
POST http://www.paypal.com/cgi-bin/webscr HTTP/1.1
Host: proxy.shr.secureserver.net
Content-type: application/x-www-form-urlencoded
Content-length: 101
Connection: close

Array
(
[cmd] => _notify-sync
[tx] => 55P70396BL2596649
[at] => JvxgO**********0-nXC
)

Then another:

IPN FATAL ERROR :: Could not establish fsockopen.
Host Details = http://proxy.shr.secureserver.net:3128 (0) Success

http://www.paypal.com/cgi-bin/webscr
Trying again without SSL ...

Then this one:

IPN FATAL ERROR :: Could not establish fsockopen.
Host Details = http://proxy.shr.secureserver.net:80 (0) Success

http://www.paypal.com/cgi-bin/webscr
Trying again without specified protocol ...

Then a final message:

IPN FATAL ERROR :: Could not establish fsockopen.
Host Details = proxy.shr.secureserver.net:80 (110) Connection timed out

www.paypal.com/cgi-bin/webscr

Help Please!!!
Bekah
10 Apr 2009, 06:14
#13
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,506
Plugin Contributions:
173

Re: PayPal problem - Order not found

You're using GoDaddy hosting ... they made changes in September 08 which broke some paypal functionality. Here's how to fix it: http://www.zen-cart.com/forum/announcement.php?f=18&a=10
15 Apr 2009, 17:11
#14
plank avatar

plank

New Zenner

Join Date:
Mar 2009
Posts:
8
Plugin Contributions:
0

Re: PayPal problem - Order not found

DrByte:

I see no obvious reason for there to be any problem with emailing when the PayPal module is sending vs anywhere else in the cart. Unless the email addresses are bad and being rejected, or something like that.


I used Paypal Push addon, and when I completed the pending order that way, the emails got sent. Do you think there is still "something" missing in that PayPal script, and thus emails are not being fired when orders are getting completed naturally?