Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

[Contribution]Paypal IPN - Devosc


devosc

Recommended Posts

if your host is THAT slow with updating i would suggest to get ASAP a new host.

better check your php & mysql version too there....LOL

My hosting service is WONDERFUL. I wouldn't part with them for the world. This is the first glitch I've ever had with them (btw, the php version is 4.3.8)

 

They use a webmaster control panel that they get from someone else, so they have to rely on *that* party to do the updates. Since the version on the install said 2.2 I assumed (duh) that it was the latest and greatest.

 

Anyway, a great big THANK YOU to Greg for getting this sorted for me. The install of OSC and his contribution went smooth as silk! I have to re-add the other stuff (CCGV) and see what I can break this time. ;)

 

Thanks again everyone!

 

Mary Ellen, not as confused and frustrated now :D

Link to comment
Share on other sites

  • Replies 2.1k
  • Created
  • Last Reply

Top Posters In This Topic

hello , i have installed paypal ipn and it works fine when customers pay in us currency but I'm having problems with Multi-Currencies. IF a custmer selects Pound as their currency and then checksout , when he reaches the paypal page every thing is again converted back to US dollars. Can any one please tell me whats wrong here

 

 

any help is greatly apprecited

 

thankyou

Link to comment
Share on other sites

Hi Haider,

Your currencies configured in the admin must have the following respective currency codes:

'CAD', 'EUR', 'GBP', 'JPY', 'USD'
If a customer selects a currency that is not specified by the above currency codes then the PayPal module will default to USD, this can be changed to any of the above currency codes in modules/payment/paypal.php (line 108)

$this->_currency = 'USD';

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

Link to comment
Share on other sites

hey Gregory thankx for replying .

this is what i have set in admin > localization > currencies

 

 

 

Currencies?

 

Currency Code Value Action?

euro EUR 1.10360003? 

UK Pound GBP 0.55000001? 

US Dollar (default) USD 1.00000000? 

Displaying 1 to 3 (of 3 currencies) Page 1 of 1

 

and my default currency on the site is USD and same in paypal.php its set to USD. Now the problem is when customers select a different currency mostly its "GBP" all the us dollar prices converts to GBP and they can see their total and every thing in it , but when they confirm the order and the paypal window pops up where they enter paypal login and stuff , over there the currency changes back to USD instead of GBP .

 

please help me figure this out , i guess i doing something wrong

 

thankyou

Edited by sinryder
Link to comment
Share on other sites

I noticed something after installing the Paypal IPN. When the users do the check out and redirects to paypal if the users tries to go back and don't want to continue the order I receive an order notification pending from my admin. Why is that? Any body getting the same problem?

Link to comment
Share on other sites

yep, only our customers are telling us that the paypal page logs them out and they can't check out at all.

Then in the admin panel it shows the payment as pending...

Link to comment
Share on other sites

Are you using the PayPal_Shopping_Cart_IPN contrib? This contrib will *only* send order confirmation emails to the customer *only* when an IPN is received and it's Payment Status is 'Completed' at which time PayPal will also directly send you an official Payment Receipt.

 

If you have Debug Email Notifications enabled in your osC->Admin PayPal config then you will receive emails regarding IPN posts, these notices do not neccesarily mean an order has been Completed.

 

If more information can be provided, may help to determine the problem.

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

Link to comment
Share on other sites

greg,

When I'm checking orders out, if an order has been paid with paypal, the paypal logo does not show up.

I'm not sure where to add the picture to or where to point the code to.

 

paypal.jpg

 

 

When i look at the html source code, the reference that it shows is

<td class="infoBoxContent"><br>Payment Method: PayPal <img src="includes/module</td>

which doesnt tell me much.

Link to comment
Share on other sites

Hi Jose,

 

Are you modifying or has the PPSCIPN contrib been modified? In version 2.6x there is no logo displayed by default in that particular section, of admin orders, what should be there is the actual Payment Status.

 

Because there is no DIR_WS_CATALOG_MODULES constant available, one would have to use

DIR_WS_CATALOG_LANGUAGES.'../modules/payment/paypal/images/paypal_logo.gif'

Nice idea, although the PayPal logo doesn't have a transparent background.

Edited by gregbaboolal

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

Link to comment
Share on other sites

Hi,

 

if a customer place an order and was redirected to paypal and do not complete payment an order with "Paypal pending" status is created.

If the customer want to complete payment, normally he has to order again. So is there a possibility to place a button to the order history page so customers can completing payment?

Edited by Mad_Nico
Link to comment
Share on other sites

Hi,

i have installed the Paypal IPN contrib and am having a couple of simple problems. Ive been testing through the sandbox and my orders are processed. But when i go to 'continue' - to return to the store site - the url listed is just http://checkout_success.php/?success=yes or similar.

There is no server name in the link and the extra '/' before the ?success.

If i manually type in the correct url then the return to my site works and the user cart gets cleared.

 

Where is the missing server address ? or where should i look to add this back in ?

I guess its one of the variables passed to paypal, since all the info suggests i leave my ipn url blank on the sandbox.

 

Second problem is with my orders in the admin section customers->orders

I get a SQL error 1064 as below:

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 'limit 0, 20' at line 1

select o.orders_id, o.customers_name, o.payment_method, o.date_purchased, o.last_modified, o.currency, o.currency_value, s.orders_status_name, ot.text as order_total from orders o left join orders_total ot on (o.orders_id = ot.orders_id), orders_status s where o.orders_status = s.orders_status_id and s.language_id = '1' and ot.class = 'ot_total' order by limit 0, 20

 

Mysql version is 4.0.20 but dont think this is the issue.

The offending line is in the catalog/admin/orders.php file (v1.112)

around line 437 in my version of this file. But its not something that this contrib has touched and im not sure if i had een looked at the orders until now as ive been testing other parts of teh site.

The query string is:

 $orders_query_raw = "select o.orders_id, o.customers_name, o.payment_method, o.date_purchased, o.last_modified, o.currency, o.currency_value, s.orders_status_name, ot.text as order_total from " . TABLE_ORDERS . " o left join " . TABLE_ORDERS_TOTAL . " ot on (o.orders_id = ot.orders_id), " . TABLE_ORDERS_STATUS . " s where o.orders_status = s.orders_status_id and s.language_id = '" . (int)$languages_id . "' and s.orders_status_id = '" . (int)$status . "' and ot.class = 'ot_total' order by $order";

 

Anyone see a problem with this ?

 

so far i havent got an IPN showing but if i get the return url working i hope to be closer..

 

Any help will be appreciated.

Regards

Mark Brindle

Link to comment
Share on other sites

Are you using the PayPal_Shopping_Cart_IPN contrib? This contrib will *only* send order confirmation emails to the customer *only* when an IPN is received and it's Payment Status is 'Completed' at which time PayPal will also directly send you an official Payment Receipt.

 

If you have Debug Email Notifications enabled in your osC->Admin PayPal config then you will receive emails regarding IPN posts, these notices do not neccesarily mean an order has been Completed.

 

If more information can be provided, may help to determine the problem.

Yes, I am using 2.4 I believe. You had helped me with installing it previously and did a wonderful job!

 

I cannot seem to replicate the issue that the customers are experiencing more than one time. My sister had the same issue when running a test, but only had the issue once.

 

What happens is, when they are at the paypal site, it requests them to login. Then they are redirected to a Paypal page that asks to submit payment. When the submit button is pressed, the customer is redirected to a page that says they must be logged in.

The order shows up as 'pending' in the OsC admin panel, but payment via paypal is never recieved. My mom ends up sending a direct bill through her Paypal account and has the user to check out using the money order option. (updates her inventory that way)

 

Could this possibly be an IE Temp file issue or browser issue on the end user's side?

Or possibly a Paypal webpage error? As it seems the issue occurs on the Paypal domain.

Link to comment
Share on other sites

Hi Jen, I thought the username seemed familiar.

 

There are a few problem areas here, 2 PayPal seem to be PayPal related, since if the customer has to move around the PayPal site, too much, eg. not begin to start their payment process within say 2 clicks then the shopping cart info can be lost by PayPal, secondly PayPal seems to not be returning the customer with the osCsid, which causes the cutomers session to be lost and so they are prompted to re-login.

 

However, v2.5 and above I think, resolved an issue where if the customer went to the PayPal site but then clicked back without making payment, their cart info would be lost and they would have to start all over again, this problem was addresses in v2.5++, v2.6a is the latest version, however some care might need to taken when upgrading, the easiest way is to not want to worry about keeping previous IPNs (since the orders have been received and processed) and just start a fresh (this will not lose any order info but it will prevent and IPN info those orders from being shown, but the mysql auto-increment value of the new table must be greater than the number of old IPNs).

 

Maniac, have a look at your configure file, your settings are wrong, see the forums for more info, something to do with SSL maybe and related to HTTP_SERVER, HTTPS_SERVER and where the third line is true or false.

 

Nico, see the FAQs.

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

Link to comment
Share on other sites

Ugh, I can't edit my post above.

 

I had a closer look at my ipn.php as I recalled changing the filename of it previously. Sure enough, I was still using a 2.3 version of the ipn file along with my mom's paypal account pointing to the older version. I am hoping that switching it to the 2.4 version did the trick.

 

Any input on the issue is welcomed as I'm interested in knowing if this is the cause or whether it could possibly be a paypal or end user issue/error.

 

Thanks!

 

//edit: ah we must have been posting about the same time. Lol thank you so much for the feedback! I will try the upgrade in a week or so, she is stocking on Saturday and I'm afraid that I might mess things up again - so I don't want to create an 'emergency' so to speak. :) Again, I appreciate your support!

Edited by StarryJen
Link to comment
Share on other sites

Greg,

well, it turns out that is not the paypal logo that is trying to show up.

that is just the paypal status. This red X as shown in the picture happens when the paypal payment wasnt submited. For example, I was placing a dummy order and when I was in the paypal site about to complete the payment, my computer crashed. When I logged back in to the admin section to see if the order had registered, it did register although not as completed and the little red X showed up instead of telling me the usual "Payment Status: Completed"

 

Can this be changed so it displayes "Payment Status: Not Completed" instead?

 

and while we are at it, the paypal logo too for kicks :D

Edited by wnfaknd
Link to comment
Share on other sites

Thanks Greg

Maniac, have a look at your configure file, your settings are wrong, see the forums for more info, something to do with SSL maybe and related to HTTP_SERVER, HTTPS_SERVER and where the third line is true or false.

yep my configure.php was wrong and now my return link works fine from paypal and the cart is cleared.

This had also screwed my links on site to checkout etc too.

 

However, IPNs are not showing in the admin for these transactions.

Nor is any product being removed from my stock list (am using low stock report contrib v1.3) or showing up in the customer orders total (reports->products purchased).

My customer->orders still gives the same SQL error message - which may be related to there being no orders in the table i suppose.

 

But i do have a value figure in the Reports->customer orders total against the user id - this value gets added to BEFORE i actually get the link back from paypal which is probably not right, since the user hasnt physically paid by then.

 

I suppose the IPN not showing is the first place to start looking..

Regards

Mark Brindle

Link to comment
Share on other sites

Ive now sorted the SQL error - i had a really duff admin\orders.php file as a base that had some wierd stuff with hardcoded images (ic_up.gif..) that i cant find where it came from, but starting with the original 2.2 and adding the payal ipn contrib it now works and i can see my customer orders. Hurrah !

 

However - still no IPN returned by payal, so no ipn info showing in the admin area. And all my orders remain as 'pending'.

 

Also no stock deductions - even when i update an order to 'processing' or 'delivered' - although not sure if that would make the stock actually change anyway.

 

So when should my stock count be reduced ? Is this only going to happen when the IPN is returned ?

 

One last problem is the order history box - the links in here are wrong and actually vary depending on what page you are in (as a user).

If you are on a products page looking at pid=34, then the order history links are:

/shop/product_info.php?products_id=34&action=cust_order&pid=xx

where xx = pid of the product in the order history list

note the products_id=34 part is related to the page you are viewing

 

If you are in say conditions.php then the links from order history box will be

/shop/conditions.php?action=cust_order&pid=xx

where xx is the pid of product in order history

 

If i actually go into the order history page (via My account->) the real links to the actual orders are

/shop/order_history_info.php?order_id=x

where x = order number

 

I might just remove the order history box for the time being and force users to look in the history via 'My account'. But it would be nice to fix this too..

 

Thanks

Regards

Mark Brindle

Link to comment
Share on other sites

Ive just tested using the 'IPN test' facility - and have got an IPN back okay (with type INVALID). This also shows up in my customer orders and now reduces my stock count too.

 

So...

everything is working sort of .. but why cant i get an IPN back from the sandbox ??

I will try the other suggested testing option of using live paypal with a 0.01 item and see if that does work. I have a number of real paypal accounts to play with.

 

Incidently - the addition of the checkout text

You do not need to be a PayPal member to pay by credit card

does not seem to be true. Unless i am missing something - with UK paypal merchant accounts you cannot take payment unless the customer has a paypal account. Is this a US only thing - as the merchant tools in teh paypal account does not have a facility to allow this ??

 

Apologies for turning this into a bit of a blog - but i think you are all on a different timezone to me.

Thanks

Regards

Mark Brindle

Link to comment
Share on other sites

Just did a 0.01 transaction, but same as using sandbox - i.e no IPN received from Paypal.

i get the emails to customer and admin from ebay saying that transaction has been performed. and i get the same checkout return, but no IPN.

 

Ive noticed on other posts - do we need to set the digest key to match the PAYPAL data key and switch paypal data ON ? Or is that a red herring. ?

 

so am a bit stumped now.

I always also get a script error on the paypal entry page from IE too which isnt good either but doesnt seem to stop anything from working...

Regards

Mark Brindle

Link to comment
Share on other sites

I now notice in my server logs that im getting a 401 for access by paypal address:

66.135.197.164 - - [01/Sep/2004:19:14:13 +0100] "POST /shop/ipn.php HTTP/1.0" 401 1273 "-" "-"

This comes up 4 times every time i do a transaction. But still get no IPN from paypal. Ive tried setting the ipn.php file to 777 but that makes no difference.

 

Im also not getting any debug emails which doesnt help.

Why is the POST from paypal being blocked at my server ? (if that is what is happening)...

Regards

Mark Brindle

Link to comment
Share on other sites

go into the admin area of the store, configuration, logging and turn on sql logging, to see what is happening there, perhaps something isnt getting thru that part which needs to go to paypal

Link to comment
Share on other sites

I feel like a bit of an idiot - just realised i have a login/password authentication for my /shop/ (catalog) directory - to stop anyone getting in whilst i am building it !!!

Hence the 401.

Still cant test it though until i get the username disassociated with the directory, but looks hopeful..

Regards

Mark Brindle

Link to comment
Share on other sites

you can make an index.html file in your directory to avoid people from looking at the store. if they type yourstore.com it will just go to the index.html where you can just write "under construction", and get rid of the password.

to access your site you would have to type yourstore.com/index.php

 

This is what i do.

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