Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

PayPal_Shopping_Cart_IPN


devosc

Recommended Posts

Greg,

 

Thanks for that. Once I used the info from an actual order with the test.html form it went through and was entered in the database.

 

So I assume that for real orders, they are not written to the database until paypal responds with the order confirmation?

 

One other question. In the dump of the html from the checkout_confirmation page, I do not see a field for txn_id. Where does this number come from? For the test I just used the default one that you wrote there, but for real orders, one must be sent with each order.

 

here is the list of fields from my confirmation page (I have removed some of the values)

<form name="checkout_confirmation" action="https://www.paypal.com/cgi-bin/webscr" method="post">

<input type="hidden" name="cmd" value="_ext-enter">

<input type="hidden" name="business" value="">

<input type="hidden" name="image_url" value="">

<input type="hidden" name="return" value="">

<input type="hidden" name="cancel_return" value="">

<input type="hidden" name="item_name" value="">

<input type="hidden" name="redirect_cmd" value="_xclick">

<input type="hidden" name="amount" value="20.00">

<input type="hidden" name="shipping" value="0.00">

<input type="hidden" name="rm" value="2">

<input type="hidden" name="cancel_return" value="">

<input type="hidden" name="custom" value="">

<input type="hidden" name="currency_code" value="USD">

<input type="hidden" name="email" value="">

<input type="hidden" name="first_name" value="">

<input type="hidden" name="last_name" value="">

<input type="hidden" name="address1" value="">

<input type="hidden" name="address2">

<input type="hidden" name="city" value="">

<input type="hidden" name="state" value="0">

<input type="hidden" name="zip" value="">

<input type="hidden" name="lc" value="">

<input type="hidden" name="no_note" value="0">

<input type="hidden" name="cn" value="Add Comments About Your Order">

<input type="hidden" name="cs" value="0">

<input type="hidden" name="item_number" value="">

<input type="image" src="includes/languages/english/images/buttons/button_confirm_order.gif" border="0" alt="Confirm Order" title=" Confirm Order "></form>

Link to comment
Share on other sites

  • Replies 1.1k
  • Created
  • Last Reply

Top Posters In This Topic

The transaction id, txn_id, is a unique alphanumeric code generated by PayPal once the customer has handed over the spondolies. If you see the lengthy post on the first page of this thread you will see why it is not possible (feasible) to pass the osC (order_id) to PayPal. Doesn't mean we couldn't generate our own invoice number for example, but currently doesn't seem feasible to generate an actual 'order' until notification from PayPal is received that a payment has been made etc. Once an IPN has been received, an a subsequent order is registered, the store's email notfications then contain the usual 'order_id'.

 

That ipn_test.html page is to sort of mimick the IPN that PayPal would send, not the info sent to PayPal when the customer clicks your confirmation button.

"Any fool can know. The point is to understand." -- Albert Einstein

Link to comment
Share on other sites

Hi greg,

 

I have finally got a connection ok with the test.php by using fopen instead of the usual. However, I have modified ipn.php to use the following:

 

}

if(!$curl_flag) {

$header .= "POST /cgi-bin/webscr HTTP/1.0\r\n";

$header .= "Content-Type: application/x-www-form-urlencoded\r\n";

$header .= "Content-Length: ".strlen($this->_response_string)."\r\n\r\n";

$socket = 'ssl://'; $port = '443';

$fp = @fopen ('$domain','rb');

if(!$fp) {

$socket = 'tcp://'; $port = '80';

$fp = @fopen ('$domain','rb');

}

if(!$fp) {

//HTTP ERROR

if($this->_debug) $thi

 

 

 

but I then get the following:

 

Warning: Cannot add header information - headers already sent by (output started at /home/virtual/site14/fst/var/www/html/catalog/includes/classes/paypal/ipn.php:272) in /home/virtual/site14/fst/var/www/html/catalog/includes/functions/general.php on line 29

 

along with HTTP error emails.

Link to comment
Share on other sites

First off, thanks for this new paypal ipn installation...although still not installed one time perfect but still less trouble than the v.0.981 ones.......

 

however, greg, sorry to bother with this problem.....but after all the installations...I have got this message.....I have no idea of why...but to check it again and again......

 

Warning: main(catalog/admin/includes/application_top.php): failed to open stream: No such file or directory in /home/yadyshop/public_html/catalog/admin/orders.php on line 13

 

Fatal error: main(): Failed opening required 'catalog/admin/includes/application_top.php' (include_path='.:/usr/local/lib/php') in /home/yadyshop/public_html/catalog/admin/orders.php on line 13

 

 

It happens when i click the orders belong to the customers from the admin area......

 

catalog/admin/includes/application_top.php.....I don't know what is wrong with this.....according to my site root..it should be right.....?? :unsure: :(

 

Mark Chiu

OS-commerce is great, but with other magical contributions, that is just so "COOL"!

Link to comment
Share on other sites

Mark,

 

I can't really see what's happeining, as you probably know application_top.php is the backbone of osC. If it won't load in orders.php then why is your admin section still working?

 

Backup the admin/orders.php, copy over the one found in this contribution. That's about all I can suggest for now. Seems like you are jinxed with php :P, I'm sure its something simple, but that at this time that error message is a bit too elusive.

"Any fool can know. The point is to understand." -- Albert Einstein

Link to comment
Share on other sites

Hi

 

This contribution is great, and works fine, except for one thing - It won't log the order unless you hit continue at the paypal page! I have everything setup right, it accepts IPNs, etc, but it won't log the IPN and order unless you hit continue. I was told to install this by somebody because they said it would eliminate this problem.

 

Please advise :help:

Link to comment
Share on other sites

Well I knew there was blank space somewhere - thanks :rolleyes:

 

It certainly sends you messages telling you the items the customer has bought if the customer doesn't hit continue. Does it actually complete the order though -ie. add it to orders.php?

Link to comment
Share on other sites

Hmm, definitely not logging the orders for me unless I hit continue. This is mindboggling - I know I installed everthing correctly!

 

Any thoughts?

Link to comment
Share on other sites

Cheers Guys,

 

I'm getting tied up with other stuff.

 

crazearcade, have you enabled and configured IPN in your PayPal account profile?

"Any fool can know. The point is to understand." -- Albert Einstein

Link to comment
Share on other sites

Cheers Guys,

 

I'm getting tied up with other stuff.

 

crazearcade, have you enabled and configured IPN in your PayPal account profile?

Yes, I've enabled IPN - that's the thing, it WILL log the IPN but ONLY when I hit continue - I have noooo idea what is causing this....

Link to comment
Share on other sites

what are your configuration settings?

 

You have to try and provide a little more info about your environment, syaing it doesn't log the ipn, is not sufficient enough for me to start to help.

"Any fool can know. The point is to understand." -- Albert Einstein

Link to comment
Share on other sites

Hi,

 

Here is how I have it set up:

 

PayPal

 

Enable PayPal Module

True

 

E-Mail Address

[email protected]

 

Business Name

[email protected]

 

Transaction Currency

Only USD

 

Payment Zone

--none--

 

Set Order Status

Processing

 

Sort order of display.

0

 

Background Color

0

 

Enable Store Logo

0

 

Store logo

oscommerce.gif

 

Include a note with payment

0

 

Shopping Cart Method

1

 

Email Notifications

2

 

Test Mode

0

 

Notification Address

[email protected]

 

If there is anything else you need to know, please let me know, I'm a noob to PHP. I simply installed this following the instructions in the 1.5 zip - enabled PayPal IPN, uploaded the files, and added the SQL tables.

Link to comment
Share on other sites

Hi C,

 

thats looks ok, in your paypal account the notification url should be:

 

http://www.crazearcade.com/catalog/ipn.php

 

did you have httpS ? probably not.

 

You should of recieved a couple of emails by now saying that you 'received an unkown post, are you running any tests?'.

 

All I can suggest for now, is to try again, but before hitting the last continue button on PayPal, check osC admin AND check your emails. You should at least receive a DEBUG email.

 

One problem might be your primary 'Email-Address' being the same as your 'Business Name' - I don't really see why it should be a problem, you will receive an email about the receiver_email detailing your config settings to that what PayPal is saying they are.

 

If you don't get any emails prior to cliking the continue button, then PayPal might not have had time to successfully send the IPN to your site. But you would of received subsequent 'duplicate' transaction emails.

"Any fool can know. The point is to understand." -- Albert Einstein

Link to comment
Share on other sites

Hi C,

 

thats looks ok, in your paypal account the notification url should be:

 

http://www.crazearcade.com/catalog/ipn.php

 

did you have httpS ? probably not.

 

You should of recieved a couple of emails by now saying that you 'received an unkown post, are you running any tests?'.

 

All I can suggest for now, is to try again, but before hitting the last continue button on PayPal, check osC admin AND check your emails. You should at least receive a DEBUG email.

 

One problem might be your primary 'Email-Address' being the same as your 'Business Name' - I don't really see why it should be a problem, you will receive an email about the receiver_email detailing your config settings to that what PayPal is saying they are.

 

If you don't get any emails prior to cliking the continue button, then PayPal might not have had time to successfully send the IPN to your site. But you would of received subsequent 'duplicate' transaction emails.

1 - No, I removed the S

 

2 - I'm not getting any emails mentioning an unknown post, actually, no error emails at all

 

3 - I don't even get a debug email, I only get the paypal "payment sent" email, I have to get continue to get the store order confirmation email. And that's all I get.

 

Also, the only way I've tested this, is through going through the whole checkout - I couldn't figureout how the 1 cent transaction tester page thing worked.

 

If anybody has any thoughts, let me know, i'd appreciate it :blink:

 

This is soooo frustrating -_-

Link to comment
Share on other sites

C,

 

Ok, first we have to sort out the no email problems.

 

Upon installing the module in osC admin, I'm assuming that [email protected] is there in all the email fields

 

Now go to:

http://crazearcade.com/catalog/ipn.php

 

In your browser, you will get a blank screen.

 

Now check your email, you should get one saying something like:

 

STORE_NAME PayPal IPN: unkown transaction type

---------------------------------------------

I received an unkown post from {some i.p address}

Are you running any tests?

 

If not, there is something possible up with your server platform, are you using Apache with Windows? I've only tested this contrib on Apache/Linux.

 

If you look in the previous posts in this thread you will see how to do a 'test'.

 

Can't be of much more help right now, other than to specifically look at your system, which I don't have time to do this week.

"Any fool can know. The point is to understand." -- Albert Einstein

Link to comment
Share on other sites

Clicked the link, got no email :-( . This is on a linux box w/ apache...

 

Is there any other contribution that does something similar to this? I could always uninstall this one and try that one...

Link to comment
Share on other sites

Have you tried to run the ipn_test.html, as suggested?

 

No-one else has had problems receiving emails, thats a basic feature of PHP?

Seems like PayPal IPN v0.981 might be more suitable to you, but don't hold me responsible for that suggestion.

"Any fool can know. The point is to understand." -- Albert Einstein

Link to comment
Share on other sites

Hey Greg, any news on 1.6? No beer for you until you add in that feature that switches to aggregate mode when calculating tax...lol...just kidding, my 1.5 is installed and working great...my client will be going live real soon and was stoked about how well your PayPal module works!

 

Just wanted to say thanks again!

Link to comment
Share on other sites

Have you tried to run the ipn_test.html, as suggested?

 

No-one else has had problems receiving emails, thats a basic feature of PHP?

Seems like PayPal IPN v0.981 might be more suitable to you, but don't hold me responsible for that suggestion.

Yes, I've ran the ipntest file, and got *no* emails. AFAIK it's all configured correctly. I'm not getting *any* emails related to this module, only paypal payment received emails.

 

I guess I will try to uninstall this, and then install the other one. Will it affect anything if I leave that my sql table in the database?

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...