Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Official PayPal IPN Support Thread


Mark Evans

Recommended Posts

Sorry for the spam:

 

I've also found that when a user purchases something in this way, they get an error in their order history:

 

 

1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '-10, 10' at line 1

 

select o.orders_id, o.date_purchased, o.delivery_name, o.billing_name, ot.text as order_total, s.orders_status_name from orders o, orders_total ot, orders_status s where o.customers_id = '364' and o.orders_id = ot.orders_id and ot.class = 'ot_total' and o.orders_status = s.orders_status_id and s.language_id = '1' and o.orders_status != '50000' order by orders_id DESC limit -10, 10

 

(for a paypal payer anyway)

Link to comment
Share on other sites

I have just completed the Sandbox testing. I didn't find that the order comment in the Admin Customers\Orders was updated but perhaps that is because it is testing mode while the FAQ indicated that the order comment status would be updated as the payment process proceeded. Is this correct or am I missing something?

 

Also, I noticed as I was switching customers that since the first customer selected PayPal as the payment method that after logging out and logging in as a different customer that when I went to pay that PayPal was selected instead of the payment method that is sort order 1. Is this because of a cookie situation since I am using the same PC or is something in the code that can fixed such that the default is always displayed according to the sort specified in the Admin Module\Payment?

 

Thanks for this wonderful contribution.

Link to comment
Share on other sites

Please refer to my error log debug file in the post referenced above (one page before this post) and reply back with the outcome. Without a proper debugging method it's all guesswork so please take a look at my post & file and then we should be able to help you further. all the best - Terra

 

Ok, where can I located ipn.php file in my /store directory? I looked into several directories under my OS Commerce directory and can't locate it.

 

Please advise.

 

Thanks.

Jason Miller

www.jamz.net

Link to comment
Share on other sites

Getting that error means that you are using a version of osCommerce 2.2 MS2 that is at least one and a half years out of date. Go to www.oscommerce.com, downloads section, download the latest osCommerce 2.2 MS2 and update using the manual update files.

 

Vger

Sorry for the spam:

 

I've also found that when a user purchases something in this way, they get an error in their order history:

1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '-10, 10' at line 1

 

select o.orders_id, o.date_purchased, o.delivery_name, o.billing_name, ot.text as order_total, s.orders_status_name from orders o, orders_total ot, orders_status s where o.customers_id = '364' and o.orders_id = ot.orders_id and ot.class = 'ot_total' and o.orders_status = s.orders_status_id and s.language_id = '1' and o.orders_status != '50000' order by orders_id DESC limit -10, 10

 

(for a paypal payer anyway)

Link to comment
Share on other sites

I apologize if this has been addressed before. I could not find any information using the search times I tried. :)

 

I am using osCommerce_PayPal_IPN_v1.4 and it has been working fine for some time now, however, about 1 out of 10 orders sent from checkout_confirmation.php land on the paypal home page instead of my business account payment page.

 

https://www.paypal.com/cgi-bin/webscr shows in the address bar so I am thinking that it must have something to do with the POST info not being sent or being corrupted. Hitting the back button and resubmitting once or twice generally gets the order through to the payment page but the customer does not know to do that, so sales are being lost and support tickets are being sent. :(

 

I am on a shared server with cache off and have tried sessions force cookie enabled and disabled with no difference in the results.

 

Looking at the source of checkout_confirmation.php the form is fully populated with the correct information to POST to paypal

 

Any ideas?

 

Thanks,

Ted

Link to comment
Share on other sites

Getting that error means that you are using a version of osCommerce 2.2 MS2 that is at least one and a half years out of date. Go to www.oscommerce.com, downloads section, download the latest osCommerce 2.2 MS2 and update using the manual update files.

 

Vger

 

Hi,

 

Thanks for that - that's a non-trivial series of patches that doesn't address my main problem (important though the patching is). The primary problem is that of the Paypal / Nochex non-authorisations. These were working absolutely fine up till the 5th - would you happen to have any suggestions for those as well? Once I have that sorted out and working again, I'll tackle the updates

 

 

Thanks

Edited by veral
Link to comment
Share on other sites

I have installed this contribution and I wish to thank everybody that worked on it. It's a very good contribution.

I got it working almost perfectly the first time :)

 

One quick question: When I look a the order details of an order paid with Paypal, I see 3 different status:

 

(1) "Preparing [Paypal IPN]"

(2) "Processing" with the comments "PayPal IPN Verified [Completed (Unverified; $99.11)]"

 

So far so good. But a few seconds later, the status is updated to this 3rd one:

 

(3) "Preparing [Paypal IPN]" and this is the one that is notified to the customer.

 

Why is that? Shouldn't the second one be the last one if the customer returns to the store and completes the checkout process.

 

Additional info: My settings are as follows

 

Set Preparing Order Status: Preparing [PayPal IPN]

Set PayPal Acknowledged Order Status: Processing

 

Thanks in advance for the help.

 

Karim.

Link to comment
Share on other sites

Terra (and others):

My latest from the debug ipn after curl was installed:

 

[Mon Apr 9 13:25:30 2007] [error] PP TEST start

[Mon Apr 9 13:25:30 2007] [error] PP TEST PayPal is accessing the ipn file

[Mon Apr 9 13:25:30 2007] [error] PP TEST we have successfuly loaded application top and language file

[Mon Apr 9 13:25:30 2007] [error] PP TEST we are assembling the reply: cmd=_notify-validate

[Mon Apr 9 13:25:30 2007] [error] PP TEST PayPal server is www.paypal.com

[Mon Apr 9 13:25:30 2007] [error] PP TEST option2 - curl is true

[Mon Apr 9 13:25:30 2007] [error] PP TEST fp is okay

[Mon Apr 9 13:25:30 2007] [error] PP TEST option2 we start to send string

[Mon Apr 9 13:25:31 2007] [error] PP TEST option2 REPLY: INVALID

[Mon Apr 9 13:25:31 2007] [error] PP TEST result is NOT VERIFIED

[Mon Apr 9 13:25:31 2007] [error] PP TEST end

Link to comment
Share on other sites

Try modifying the code like this:

foreach ($_POST as $key => $value) {
error_log('PP TEST received POST variable: ' . $key . ' : ' . $value);
$parameters .= '&' . $key . '=' . urlencode(stripslashes($value));
 }

and then check your error log to see if you have received any $_POST variables.

[Mon Apr 9 13:25:30 2007] [error] PP TEST we are assembling the reply: cmd=_notify-validate

....

[Mon Apr 9 13:25:31 2007] [error] PP TEST option2 REPLY: INVALID

Joseph - the problem is still the same one I pointed out on page 122 on this thread - your $_POST variables are not being added to the string, hence validation fails. It's a simply PHP loop which runs through each $_POST and on your site it's empty. No $_POST variables. The problem on your site lies in the bit of code quoted above and that's where you should focus your efforts. I'm sorry but I really don't know why the $_POST variables fail on your site ... any chances there's a permission problem, something blocking them ..?? Anyway, if you get the $_POST variables to be received by your site / file then you will have solved the problem. all the best - Terra

PS: validation between PayPal and your site is by exchanging the transaction variables - on your site the reply sent back to PayPal lacks all the variables sent by PayPal to your site, hence PayPal returns the "invalid" response.

My code for combining PayPal IPN with ** QTPro 4.25 ** osC Affiliate ** CCGV(trad)

and how to solve the invoice already paid error

General info: Allow customer to delete order comment ** FTP Programs & Text Editors ** Amending order email **

Link to comment
Share on other sites

The only change I can think of is that I'd installed Subversion (Version control) to the live directory tree. (Basically I copied all the files in the live directory to another one. Made that the official repository, then immediately 'recreated' the live tree from the repository - if that makes sense)

I'm sorry but I can't help combining PayPal IPN with Subversion - if you are running Subversion on your site then you will need to make them work together or take Subversion off. As this problem is not only linked to PayPal IPN but also to Nochex, and most likely based on Subversion, I'd appreciate if you can start a new thread for your problem - if will give you more room to focus on the Subversion problem and keep this thread manageable. Many thanks for your help in keeping this IPN support thread on topic. All the best - Terra

My code for combining PayPal IPN with ** QTPro 4.25 ** osC Affiliate ** CCGV(trad)

and how to solve the invoice already paid error

General info: Allow customer to delete order comment ** FTP Programs & Text Editors ** Amending order email **

Link to comment
Share on other sites

I have installed 2.2, and I don't know how it integrate with other modules, such as credit class & gift voucher 1.9 and osc affiliate. I find detailed intruction in V1.x, but not 2.x Could someone help me about this?

Have not been written yet - any help is much appreciated though! ;) If you are not a PHP coder & your site uses CCGV & oscAffiliate, then my advise is to stick with version 1.x until the integration guidelines are available. Terra

My code for combining PayPal IPN with ** QTPro 4.25 ** osC Affiliate ** CCGV(trad)

and how to solve the invoice already paid error

General info: Allow customer to delete order comment ** FTP Programs & Text Editors ** Amending order email **

Link to comment
Share on other sites

Any idea why it's doing this:

 

I have installed this contribution and I wish to thank everybody that worked on it. It's a very good contribution.

I got it working almost perfectly the first time

 

One quick question: When I look a the order details of an order paid with Paypal, I see 3 different status:

 

(1) "Preparing [Paypal IPN]"

(2) "Processing" with the comments "PayPal IPN Verified [Completed (Unverified; $99.11)]"

 

So far so good. But a few seconds later, the status is updated to this 3rd one:

 

(3) "Preparing [Paypal IPN]" and this is the one that is notified to the customer.

 

Why is that? Shouldn't the second one be the last one if the customer returns to the store and completes the checkout process.

 

Additional info: My settings are as follows

 

Set Preparing Order Status: Preparing [PayPal IPN]

Set PayPal Acknowledged Order Status: Processing

 

Thanks in advance for the help.

 

Karim.

 

 

Thanks,

 

Karim.

Link to comment
Share on other sites

Hi,

 

I'm a newby stumbling at the gate. :)

 

I've got the PayPal IPN Module v2.2 For 2.2MS2 installed (correctly I hope). Now I'm trying to follow the configuration instructions and hitting a snag. The instructions list all kinds of configuration settings under various headings. Unfortunately as you can see from the screen shot below, only one of the boxes is actually labeled with a heading which makes me wonder where you fill in the rest of the items.

 

pay_mod.jpg

 

Is this how it is supposed to look, or should there be labels on all the boxes?

 

Help!

 

-Hank :huh:

Link to comment
Share on other sites

Not supposed to look like this... :huh:

 

 

 

 

Hi,

 

I'm a newby stumbling at the gate. :)

 

I've got the PayPal IPN Module v2.2 For 2.2MS2 installed (correctly I hope). Now I'm trying to follow the configuration instructions and hitting a snag. The instructions list all kinds of configuration settings under various headings. Unfortunately as you can see from the screen shot below, only one of the boxes is actually labeled with a heading which makes me wonder where you fill in the rest of the items.

 

pay_mod.jpg

 

Is this how it is supposed to look, or should there be labels on all the boxes?

 

Help!

 

-Hank :huh:

Link to comment
Share on other sites

I'm sorry but I can't help combining PayPal IPN with Subversion - if you are running Subversion on your site then you will need to make them work together or take Subversion off. As this problem is not only linked to PayPal IPN but also to Nochex, and most likely based on Subversion, I'd appreciate if you can start a new thread for your problem - if will give you more room to focus on the Subversion problem and keep this thread manageable. Many thanks for your help in keeping this IPN support thread on topic. All the best - Terra

 

Hi Will do.

 

Would you happen to know of any permission issues that IPN requires to run? In your experience so far I mean. That's the only thing I can think of which subversion would uh, subvert.

 

 

Thanks

Link to comment
Share on other sites

I have installed 2.2 and this is actually a very easy to setup and use contrib so far - having one problem which is, when clicking the "complete order" [or whatever it actually says] after the PayPal payment, I'm redirected back to my site and order confirmation page and there is the box at the bottom saying how long the link will be available, how many downloads, etc. except there is no active link to the product.

 

I am using the Live Site option and testing on $0.01; put the product in the downloads folder as described in the OSC documentation, checked the properties are correct on the downloads and pub folders as mentioned.

 

Another thing is the the info on the confirmation page says, in part:

 

Expiry date:

Thursday 02 December, 1999

 

Does that have anything to do with it? Any idea how can I address this?

 

thanks again

 

Would really appreciate some assistance - thanks again and all the best

Ron

Link to comment
Share on other sites

Terra:

 

Joseph - the problem is still the same one I pointed out on page 122 on this thread - your $_POST variables are not being added to the string, hence validation fails. It's a simply PHP loop which runs through each $_POST and on your site it's empty. No $_POST variables. The problem on your site lies in the bit of code quoted above and that's where you should focus your efforts. I'm sorry but I really don't know why the $_POST variables fail on your site ... any chances there's a permission problem, something blocking them ..?? Anyway, if you get the $_POST variables to be received by your site / file then you will have solved the problem. all the best - Terra

PS: validation between PayPal and your site is by exchanging the transaction variables - on your site the reply sent back to PayPal lacks all the variables sent by PayPal to your site, hence PayPal returns the "invalid" response.

 

This from the error log after adding the one line of code you suggested. (error_log('PP TEST received POST variable: ' . $key . ' : ' . $value);)

Are these all errors? I note each line says [error]. Also the customer is receiving both their confirmation email and the email that would normally go to the store owner.

Thanks for your patience and your help.

[Tue Apr 10 22:42:31 2007] [error] PP TEST received POST variable: mc_gross : 13.97

[Tue Apr 10 22:42:31 2007] [error] PP TEST received POST variable: invoice : 4802

[Tue Apr 10 22:42:31 2007] [error] PP TEST received POST variable: address_status : confirmed

[Tue Apr 10 22:42:31 2007] [error] PP TEST received POST variable: payer_id : WRCXXXXXXXXWJG6

[Tue Apr 10 22:42:31 2007] [error] PP TEST received POST variable: tax : 0.00

[Tue Apr 10 22:42:31 2007] [error] PP TEST received POST variable: address_street : 512 Main St

[Tue Apr 10 22:42:31 2007] [error] PP TEST received POST variable: payment_date : 20:42:24 Apr 10, 2007 PDT

[Tue Apr 10 22:42:31 2007] [error] PP TEST received POST variable: payment_status : Pending

[Tue Apr 10 22:42:31 2007] [error] PP TEST received POST variable: charset : windows-1252

[Tue Apr 10 22:42:31 2007] [error] PP TEST received POST variable: address_zip : 55511

[Tue Apr 10 22:42:31 2007] [error] PP TEST received POST variable: first_name : Buyer

[Tue Apr 10 22:42:31 2007] [error] PP TEST received POST variable: address_country_code : US

[Tue Apr 10 22:42:31 2007] [error] PP TEST received POST variable: address_name : Buyer Buyer

[Tue Apr 10 22:42:31 2007] [error] PP TEST received POST variable: notify_version : 2.1

[Tue Apr 10 22:42:31 2007] [error] PP TEST received POST variable: custom : 7735

[Tue Apr 10 22:42:31 2007] [error] PP TEST received POST variable: payer_status : unverified

[Tue Apr 10 22:42:31 2007] [error] PP TEST received POST variable: address_country : United States

[Tue Apr 10 22:42:31 2007] [error] PP TEST received POST variable: address_city : Hope

[Tue Apr 10 22:42:31 2007] [error] PP TEST received POST variable: quantity : 1

[Tue Apr 10 22:42:31 2007] [error] PP TEST received POST variable: verify_sign : AKqFBXXXXXXXXXXXXXX0vhVtslO8.XSlFgG

[Tue Apr 10 22:42:31 2007] [error] PP TEST received POST variable: payer_email : [email protected]

[Tue Apr 10 22:42:31 2007] [error] PP TEST received POST variable: txn_id : 0

[Tue Apr 10 22:42:31 2007] [error] PP TEST received POST variable: payment_type : instant

[Tue Apr 10 22:42:31 2007] [error] PP TEST received POST variable: last_name : Buyer

[Tue Apr 10 22:42:31 2007] [error] PP TEST received POST variable: address_state : MA

[Tue Apr 10 22:42:31 2007] [error] PP TEST received POST variable: receiver_email : [email protected]

[Tue Apr 10 22:42:31 2007] [error] PP TEST received POST variable: pending_reason : unilateral

[Tue Apr 10 22:42:31 2007] [error] PP TEST received POST variable: txn_type : web_accept

[Tue Apr 10 22:42:31 2007] [error] PP TEST received POST variable: item_name : Etc. Etc., LLC

[Tue Apr 10 22:42:31 2007] [error] PP TEST received POST variable: mc_currency : USD

[Tue Apr 10 22:42:31 2007] [error] PP TEST received POST variable: item_number :

[Tue Apr 10 22:42:31 2007] [error] PP TEST received POST variable: residence_country : US

[Tue Apr 10 22:42:31 2007] [error] PP TEST received POST variable: test_ipn : 1

[Tue Apr 10 22:42:31 2007] [error] PP TEST received POST variable: payment_gross : 13.97

[Tue Apr 10 22:42:31 2007] [error] PP TEST received POST variable: shipping : 3.37

Edited by Dennisra
Link to comment
Share on other sites

Urgent help, and probably the easiest?

 

Hi guys, i'll be honest it was easy to install, easy to access in the admin, but seriously, how long does this thing take for each of us to fix up all these errors?..... the instruction manual makes it sound so easy....

 

Here's my problem(s)......

1. When i installed the paypal ipn, enalbed it and disabled the original paypal module, now when I do a test order, clicking the same "radio" check box isnt processing to paypal..... here's the words that have been thrown at me since i first tried this "Please select a payment method for your order."

 

I'm hoping someone who is an expert on this IPN module can help me out from this very simple beginning step...

 

Thanks guys

-msf

Link to comment
Share on other sites

How is it supposed to look and what went wrong? -Hank

Hank - the module writes the data to the database, exactly the same as all other payment modules. The code for this is towards the bottom of the paypal_ipn.php file. In your case, all headings are missing which should have been written to the DB ... My advice is that this is a problem with your site, not the payment module.

 

Within paypal_ipn.php it looks like your site got wonky after this entry:

	  tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Sort order of display.', 'MODULE_PAYMENT_PAYPAL_IPN_SORT_ORDER', '0', 'Sort order of display. Lowest is displayed first.', '6', '3', now())");

because this entry was not written properly into the DB:

			tep_db_query("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Force shipping address?', 'MODULE_PAYMENT_PAYPAL_IPN_SHIPPING', 'False', 'If TRUE the address details for the PayPal Seller Protection Policy are sent but customers without a PayPal account must re-enter their details. If set to FALSE order is not eligible for Seller Protection but customers without acount will have their address fiels pre-populated.', '6', '4', 'tep_cfg_select_option(array(\'True\', \'False\'), ', now())");

this is fairly straight-forward stuff and does work "out of the box" so something is wonky on your site. all the best - Terra

My code for combining PayPal IPN with ** QTPro 4.25 ** osC Affiliate ** CCGV(trad)

and how to solve the invoice already paid error

General info: Allow customer to delete order comment ** FTP Programs & Text Editors ** Amending order email **

Link to comment
Share on other sites

Would you happen to know of any permission issues that IPN requires to run? In your experience so far I mean. That's the only thing I can think of which subversion would uh, subvert. Thanks

PayPal must be able to freely access the ipn.php in the /ext/ directory. PayPal sends a string of POST variables to the ipn.php file which are then returned by your site to PayPal via 1 of 3 possible methods: OpenSSL/port 443, cURL, port 80. That's pretty much it - the rest is standard PHP / MySQL. all the best - Terra

My code for combining PayPal IPN with ** QTPro 4.25 ** osC Affiliate ** CCGV(trad)

and how to solve the invoice already paid error

General info: Allow customer to delete order comment ** FTP Programs & Text Editors ** Amending order email **

Link to comment
Share on other sites

double post deleted

Edited by Terra

My code for combining PayPal IPN with ** QTPro 4.25 ** osC Affiliate ** CCGV(trad)

and how to solve the invoice already paid error

General info: Allow customer to delete order comment ** FTP Programs & Text Editors ** Amending order email **

Link to comment
Share on other sites

This from the error log after adding the one line of code you suggested. (error_log('PP TEST received POST variable: ' . $key . ' : ' . $value);)

Are these all errors? I note each line says [error]. Also the customer is receiving both their confirmation email and the email that would normally go to the store owner.

The [error] is only because we are using error_log to log the data to the error log - it's a convenient way to log data on a live site. Doesn't mean they are errors.

 

Your log confirms that Post variables are received. Can you post your first 100 lines of the ipn.php file on this thread? Terra

 

PS: the email we can deal with later - let's get the big picture sorted first.

My code for combining PayPal IPN with ** QTPro 4.25 ** osC Affiliate ** CCGV(trad)

and how to solve the invoice already paid error

General info: Allow customer to delete order comment ** FTP Programs & Text Editors ** Amending order email **

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...