Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

[Contribution]Paypal IPN - Devosc


devosc

Recommended Posts

OK I FIGURE IT MIGHT HAVE SOMETHING TO DO WITH:

 

Itemized Order Details
? ? ? ?for ($i=0,$index=1; $i<sizeof($order->products); $i++, $index++) {
? ? ? ? ?//$index = $i+1;
? ? ? ? ?$paypal_fields .= tep_draw_hidden_field('item_name_'.$index, $order->products[$i]['name']).
? ? ? ? ?tep_draw_hidden_field('item_number_'.$index, $order->products[$i]['model']).
? ? ? ? ?tep_draw_hidden_field('quantity_'.$index, $order->products[$i]['qty']).
? ? ? ? ?tep_draw_hidden_field('amount_'.$index, number_format($order->products[$i]['final_price']* $my_currency_value,2));
? ? ? ? ?$tax = ($order->products[$i]['final_price'] * ($order->products[$i]['tax'] / 100)) * $my_currency_value;
? ? ? ? ?$paypal_fields .= tep_draw_hidden_field('tax_'.$index, number_format($tax, 2));

Edited by dailce
Link to comment
Share on other sites

  • Replies 2.1k
  • Created
  • Last Reply

Top Posters In This Topic

With that said, are you using the test ipn in admin?

 

I have said before in, this and other forums, not to use the sandbox to test.

 

Yes I am and when I try all I get is 'page cannot be displayed'.

 

I never used the sandbox.

 

When I tested, I did actual transactions from one pay pal account to another, so I do get confirmation emails from Pay Pal, but clearly the module is not doing what it's meant to do as the order status doesn't change and the order process email does not get sent out.

Link to comment
Share on other sites

I have a small problem.

 

I have just had someone pay for there goods via paypal and paid too much. Don't really want to go into detail on that as i know why.

 

The problem was this. Because i had cart test on the ipn and cart did not match. Now then on the paypal bar in the order a button was present saying accept under the action column. I assume that this is correct since the ipn did not match the cart.

 

When i press on accept. I get an error that goes something like this.

 

Fatal Error: Cannot redeclare class order ??????? admin/includes/classes/order.php line 13

 

nothing else happens.

 

Anybody got any ideas. Before you have a go at me YES i have switched cart test off.

 

Another quick also. When in the Paypal IPN screen i get a page loaded with errors.

Any ideas on that as well while were at it.

 

Top contribution by the way. This is the only that i can get to work.

Link to comment
Share on other sites

I'm a little confused by this contribution.  Is it an API that makes a call from OSCommerce or does it take you out of oscommerce to paypal and then back again?

 

 

Basically your customer chooses the paypal option in checkout and when he clicks on confirm order he gets sent to paypal.

 

The ipn passes all the information from the order to paypal. The customer fills in his or her details.

 

When they complete the payment within paypal. Paypal then passes the customer back to your CHECKOUT_SUCCESS.PHP screen.

 

Paypal then sends a IPN to your site telling you that payment has been received.

 

Thats it basically

Link to comment
Share on other sites

Paypal then sends a IPN to your site telling you that payment has been received.

 

Thats it basically

What url should be set in paypal so that your site does something with that information?

 

i.e. www.mysite.com/catalog/?

 

I just wonder if like me a lot of people are not getting there orders up dated because they don't know where to send the IPN information.

Link to comment
Share on other sites

What url should be set in paypal so that your site does something  with that information?

 

i.e. www.mysite.com/catalog/?

 

I just wonder if like me a lot of people are not getting there orders up dated because they don't know where to send the IPN information.

 

Instant Payment Notification (IPN) On

 

Instant Payment Notification (IPN) URL: http://www.mysite.com/catalog/checkout_success.php

Link to comment
Share on other sites

Instant Payment Notification (IPN)  On

 

Instant Payment Notification (IPN) URL:  http://www.mysite.com/catalog/checkout_success.php

 

Also, I think in website preferences

 

Auto Return:

*On

Off

 

Return URL: http://www.mysite.com/catalog/includes/mod..._splash.inc.php

 

Payment Data Transfer:

*On

Off

 

Identity Token:

a whole string of numbers and letters generated by PayPal

 

Block Non-encrypted Website Payment:

On

*Off

 

PayPal Account Optional:

*On

Off

 

Contact Telephone

On (Optional Field)

On (Required Field)

*Off (PayPal recommends this option)

 

 

 

Correct me where I am wrong.

Link to comment
Share on other sites

i can't answer all the questions, but the IPN Test Panel is your friend.... you should not need to make any configuration settings in you PayPla Account, since some PayPal merchants have more than one store, hence there is no need to configure anything on their IPN configuration page...

The information provided at the beginning of this thread and in the documentation is generally uptodate....

 

If when trying to test via the IPN Test Panel you get a blank screen you will need to edit the paypal/application_top.inc.php and uncomment the line that *enables* error reporting and comment out the line below that disables error reporting...

 

If your getting the page not found, then there is a problem with your stores configuration or possibly installation of the contrib (i.e. not all the files were uploaded)

 

The sql operations in the sql script must be performed entirely... and in particular there are three alterations that must be performed, these are (or were) mentioned in the install documentation.....

 

The documentation itself is worth reading and can give a better insight into how to utilize the module itself.

 

G.

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

Link to comment
Share on other sites

Helps when you say what line 13 is, mine says this

  class order {

 

The return url doesn't have to be specified specifically, in your paypal account you can just set it to point to your main store url... and checkout_splash.inc.php is definately not correct... if anything it would be catalog/checkout_success.php... these config settings are already sepcified by the contrib module... so in the case of auto-return you just need to specify any url...

 

For the order class problem, you may need to change the AcceptOrder.inc.php so that it looks *something* like this...

if(!class_exists('order') ){
include(DIR_WS_CLASSES . 'order.php');
}

This error is probably because somewhere prior to the include AcceptOrder the class order is already being included so there is a clash occurring....

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

Link to comment
Share on other sites

The IPN test panel may be your friend, but no matter what I do, all I get is a page cannot be displayed type error. I've done multiple real transactions and IPN has never ever worked.

 

I am not the only one this is happening to, so clearly some set of circumstances causes this.

Link to comment
Share on other sites

I'm not going to get into this... a few versions ago I personally helped you with the installation so you know that things have worked at one point in time or another... I have visited your site, even though you have been reluctant to explicitly state the url and there is a specific problem with your site out side of the control of this contribution, others who have recently indicated problems here, I know have been resolved, one was because they didn't have all the db tables installed and another because they had their whole site password protected...

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

Link to comment
Share on other sites

And I've said previously, It's a totally different site, it's clearly a totally NEW version of your module, I have a different default currency and my store ISN'T installed in a catalog folder. You never asked me for the URL because if you did, I would have tripped over myself to give it to you!! It's the same URL as the old site, except for it's a .com.au

 

Clearly one of these differences makes the new site NOT WORK and as you're the person who wrote this thing, you're the only one I can ask for help. It's not a dependancy I wish to have, but I'm desperate - as you know, my families business is on the line with this website.

Edited by SamyT
Link to comment
Share on other sites

I visited your *new* site, the problem is that when I explicity type in ipn.php it does not display a blank page... which if I recall it should because [1] the request is not from paypal and [2] because there is no store digest posted in the request, it should then just display a blank screen.. having said that I did notice that if I typed in ipnX.php the server would then explicitly report that the page was not found... but when I type in ipn.php nothing happens... you can try this yourself, with the contrib in either test mode enabled or not, what should happen is that if it is an invalid request it should either display a blank page or report back with a Server Error.

 

The only reason why I mentioned about the url thing was cos it was commented out from your config file post....

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

Link to comment
Share on other sites

This is the thing, why is it showing no ipn file when I can show you that it is DEFINITELY uploaded and it is the one from the contribution package. I have checked this so many times and it's there, I've deleted it, reuploaded it and it's there. Yet it acts as if it's not there.

Link to comment
Share on other sites

This is the thing, why is it showing no ipn file when I can show you that it is DEFINITELY uploaded and it is the one from the contribution package. I have checked this so many times and it's there, I've deleted it, reuploaded it and it's there. Yet it acts as if it's not there.

Check your .htaccess file for the catalog dir... if there is anything mentioning ipn.php remove... I say that because awhile ago I did suggest that it is also possible to prevent requests to the ipn.php script that is not from paypal via the .htaccess file.. maybe this was copied over...

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

Link to comment
Share on other sites

Is it ok to leave the test panel on?

 

Also, how long does it usually take to get the IPN from PayPal?

 

ALso, I deleted an order before the IPN from PayPal was sent back, and what I notice is that the IPN shows uup in the IPN section with the "Preview" button", is this normal? How can I erase those old IPN listings?

 

When I was testing with the sandbox and on localhost it worked perfect, I would get the IPN's instantly (I think the sandbox is faster for getting IPN's). Then when I transferred it to my site it wouldn't work. So I removed the PayPal Payment module and then clicked install again. This fixed the URL in the test panl and after I played with the setting the test panel does return a "Test Complete" . So far it seems to be working, I really like this contr.

 

Keep up the excellent work!

Link to comment
Share on other sites

devosc

 

Is it ok to leave the test panel on?

 

Also, how long does it usually take to get the IPN from PayPal?

 

Also, I deleted an order before the IPN from PayPal was sent back, and what I notice is that the IPN shows up in the IPN section with the "Preview" button", is this normal? How can I erase those old IPN listings?

 

Also, I did a write and run install on a default install os OsC, and it works perfect, expect it seems that my Session ID's disappear, they worked perfect before the write and run. I also tried a manual install of this contrib. on a default OSC but it never worked for me. It's works now but do you know what could be causing the seesion ID's to disappear?

 

When I was testing with the sandbox and on localhost it worked perfect, I would get the IPN's instantly (I think the sandbox is faster for getting IPN's). Then when I transferred it to my site it wouldn't work. So I removed the PayPal Payment module and then clicked "install" again. This fixed the URL in the test panl and after I played with the setting the test panel does return a "Test Complete" . So far it seems to be working, I really like this contr.

 

Keep up the excellent work!

 

 

In my PayPal account I have IPN enabled to point to my site:

 

Here are my settings:

 

==================

PayPal

 

Enable PayPal Module

True

 

E-Mail Address

[email protected]

 

Business ID

[email protected]

 

Transaction Currency

Selected Currency

 

Payment Zone

--none--

 

Set Pending Notification Status

Pending

 

Set Order Status

Processing

 

Set On Hold Order Status

On Hold

 

Set Canceled Order Status

Canceled

 

Synchronize Invoice

False

 

Sort order of display.

0

 

Background Color

White

 

Processing logo

oscommerce.gif

 

Store logo

 

 

PayPal Page Style Name

default

 

Include a note with payment

Yes

 

Shopping Cart Method

Aggregate

 

Enable PayPal Shipping Address

Yes

 

Digest Key

PayPal_Shopping_Cart_IPN

 

Test Mode

On

 

Cart Test

On

 

Debug Email Notifications

No

 

Debug Email Notification Address

[email protected]

 

PayPal Domain

www.paypal.com

 

Return URL behavior

==================

Link to comment
Share on other sites

well I wouldn't leave it with test mode on, although you should be ok, probably wiser not to... your settings seem ok... although, depending on your needs etc, I would go through and try a live test (or even sandbox test), and see if it (paypal)) will allow you to choose the option 'no shippig address required' this you do not want to see, especially if you want to see the customers shipping address details in the *paypal* transaction details page of this contribution... so if you do then set the contrib config option Shipping Address to the other setting...

 

Yeah, PayPal can take a while to get their IPNs through to you, this could be for various reasons and not neccessarily directly because of PayPal... but in general you should expect to see the IPN more or less instantly....

 

G.

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

Link to comment
Share on other sites

I believe Paypal is upto something, they are changing stuff, or may be its just some problem at their end. So far my transactions are sending all the emails.

 

So, probably, the Paypal IPN does that at certain times only.

 

 

Well, my IPN notifications have stopped for good, so I called paypal.

 

Bottom line, they are total jerks; the response was:

 

"It can not be our problem, even if there is not connection from paypal to your site in your logs. All problems are due to osCommerce changes. We never do not send out IPN noticies and they always arrive in under 5 seconds."

 

So pissed me off I have to go buy a new phone...

 

 

Really going to suck if I have to stop accepting paypal, but as it is now it's nearly impossible to use without the IPN notifications :(

Link to comment
Share on other sites

By the way; is there a way to force a paypal order that does not get it's IPN notice back to "complete" manually?

 

That would solve most of my problems, since I do get the email from paypal the order completed; if I could at leastI could go into the admin and complete the order manually (updating stock, etc.) that would help.

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...