Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

returning from paypal to OSC, no download links


insomniac

Recommended Posts

Hi,

 

I'm a newbie to OSC & this forum (a big help so far!). Part of my shop includes selling mp3 downloads. I checked to see the downloads work by testing in cash/cheque payment mode....they work fine.

 

I've got paypal working well now thanks to the great contribution i found!

 

BUT.....when returning the customer back to my shop, the download links are not made available to them.

it returns to the checkout>success.php as it's supposed to but there are no links :-(

 

Your help would be much appreciated!

 

Thanks

Link to comment
Share on other sites

Hi Stuart,

 

Sometimes when the customer returns to the site, the corresponding IPN may not have been received in time, e.g. before they got there.

 

Download links are only made available once a IPN with a 'Completed' payment status has been made.

 

What you could do is place some additional information on that page inviting the customer to check their account_history for that order, the download links will appear in the info page for that particular order.

 

There are a few ways to go out about determining what information to provide the customer upon their return from PayPal. A quick method would be to have $ppFlag set to true within the elseif statement at the top of checkout_success.php, and then in the main body of checkout_success, if $ppFlag is true then show the greeting text also containing a link to their account history.

 

They could either refresh the page, or by the time they click to view their account history then the IPN should hopefully have been received (depending on PayPal and your server etc).

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

Link to comment
Share on other sites

Hi Greg,

 

Thanks for your quick response (& for this great contribution....)

 

unfortunately, i have still not got links appearing for the order in the 'My Account' section....and it's been a while since i placed the order.

 

 

The status does appear to have gone to 'processing' as it should when i check in the admin orders section and i have received the payment into my paypal account (this was my first 'live' test with my girlfriends paypal account!)

 

FYI: I have auto-return on paypal set to url:........./shop/checkout_success.php

 

I know you said it wasn't required but when i switched auto return on it insisted on a URL. This is correct url though?

 

Any further help & suggestions would really be appreciated....desperate to get this last hurdle sorted out!

 

Thanks,

Stu

Link to comment
Share on other sites

Hi Stuart,

 

It doesn't matter exactly which url you specify in your pp acount profile as the ppscipn payment module specifies the correct url, in particular ut correctly includes the session id.

 

I just did a test pruchase on the default downloadable 'Unreal Tournament' product in osC and things went through smoothly, e.g the download links appeared - however downoads must be enabled in you osc admin->configuration-section, as you may already be aware of.

 

Which ppscipn version are you using? v2.7 was released yesterday and today I uploaded a version with an over write and run directory which you could try on a fresh osC test site to compare.

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

Link to comment
Share on other sites

thanks again.

 

to be honest i'm not sure what you mean by 'ppscipn' version? (sorry....Novice!)

 

 

i'm just going to check again that the download links still appear without Paypal switched on (but i won't 'remove') (i'll do it through cash/check). I assume this would be worth checking....

 

Sorry for being a pain, it must be annoying having all these Q's from ppl who don't know much about the coding side..... :rolleyes:

 

Cheers,

Stu

Link to comment
Share on other sites

yes, i get the download link no problem when paying with 'cash'.

 

I thought perhaps i might have made a mistake regarding the 'status of order'

i followed your installation notes to the letter.....selecting pending & processing where you said to (opposite way round to suggestion in paypal edit).

 

I've just tried to change status of order from processing back to pending for that order in case that was something to do with it, but it still has not made the d/l links appear.

 

BTW: when i changed the status in admin orders i got an error.....

 

Warning: Cannot modify header information - headers already sent by (output started at /home/lange204/public_html/shop/admin/includes/languages/english/orders.php:84) in /home/lange204/public_html/shop/admin/includes/functions/general.php on line 18

 

 

i suspect it's not relevant though....

 

Cheers

Stu

Link to comment
Share on other sites

  • 2 months later...

I'm having some similar problems with the download not working after installing the Papal IPN contribution, and have not been able to find the solution while searching this thread or elsewhere in these forums.

 

What I installed

- I installed the downloads controller

- I created an Order Status "Updated", checked its value in the orders_status table, and set its value in the Admin to 4 .

- I set the Downloads Controller Orders Status Value to 2.

- then I installed the PayPal_Shopping_Cart_IPN 2.9 .

 

What I tested:

- I entered an order and paid with the PayPal sandbox

- I was returned to the osCommerce order page, and no download button was available, as expected since the order status was 'pending'.

 

The problem:

There should have been a message on the order saying "NOTE: Downloads are not available until payment has been confirmed", but there was no such message.

 

I also checked:

- When I manually changed the order status so that the orders status value was 2 or above, but no download button appeared.

- I checked the downloads controller using the credit cart test and everything worked fine.

 

Any help would be greatly appreciated.

Thank you

Barry

Link to comment
Share on other sites

some additional information about my downloads controller installation:

 

Installation

In my installation of the downloads controller, I did not update the admin/orders.php file. (It appeared from the instructions that this update was optional, and given that the download function works fine when tested with a credit card, I assume that is true).

 

Reported overlap

I also found this forum post on incompatibility problem. It appears that both the downloader controller and the Paypal IPN installation edit the same lines. In the forum it appeared the problem was never solved and the person posting gave up and used the older version PayPal IPN v1.5. For this reason I'm hesitant to try and integrate the two contributions in this file since I really don't understand the code.

 

Was there ever a resolution of this issue?

 

However I think the problem I report above is in the catalog side of the application and not on the admin side (is that a correct assumption?)

 

Any ideas what I should do?

 

Thanks

 

Barry

Link to comment
Share on other sites

Further information on Incompatibility of Paypal IPN contribution and downloads controller

 

Problem narrowed to

The problem appears to be that when the customer pays with PayPal, no records are being created in the orders_products_downloads database.

 

(if I manually put in the records, the download button appears).

 

Question

Does anyone know which file is causing the problem?

Link to comment
Share on other sites

Further information on Incompatibility of Paypal IPN contribution and downloads controller

 

Problem narrowed to

The problem appears to be that when the customer pays with PayPal, no records are being created in the orders_products_downloads database.

 

(if I manually put in the records, the download button appears).

 

Question

Does anyone know which file is causing the problem?

 

Hi there. I can confirm this. I too installed the latest version of Paypal IPN and everything works grant except that the download data is not being inserted into the orders_products_downloads tables of the database.

 

I'm guessing that with the problem narrowed it won't be too hard to fix. I'd try but I'm still too new to the code.

Link to comment
Share on other sites

  • 2 months later...
Hi there. I can confirm this. I too installed the latest version of Paypal IPN and everything works grant except that the download data is not being inserted into the orders_products_downloads tables of the database.

 

I'm guessing that with the problem narrowed it won't be too hard to fix. I'd try but I'm still too new to the code.

 

Did anyone ever fix this????

Link to comment
Share on other sites

i just uninstalled it. not worth the headache.

 

ms

 

Hi

 

I think the cotribution can be fixed.

 

Your problems seem similar to mine. For me, it gives the download page, but no link and a old date when using Paypal ipn or Nochex APC. Ive done a bit of testing with it and I think this is how it should be setup (even though its not yet working properly). Setting it up like this will stop non authorised downloads.

 

I think the no link problem either lies in the coding for admin/orders.php or download.php and is a seperate issue (which is the one that needs to be fixed).

 

I have setup download controller as follows:

 

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

 

Within download manager in config.

 

Downloads Controller Update Status Value = 999999

Downloads Controller Order Status Value = 999998

 

Ive renamed "updated" to "Authorised" and gave it the value of 999999 (set in phpmyadmin)

 

Ive made the value so high so Paypal IPN, or Nochex aren't affected (their values are 50000 & 99999). If i didn't do that, even if a payment wasn't made, the download would be enabled. Within admin/ mod/ payment mods, I have set both of these so that once the payment is authorised, they go to "authorised" (i.e 999999) and not default.

 

Ive tested Paypal and Nochex and after a payment they do go to "authorised" as they should. If the payment isn't authorised the message not letting the user download anything is shown and they remain at pending as they should.

 

When the payment is authorised, it says somthing like this:

 

Product name:

Tuesday 07 December, 1999 5 downloads remaining

 

but no downlad link. Also note the date.

 

I then go to admin, orders and manually update the order to authorised and then the download link works; the link appears and the date is corrected. So the order status would read paypal processing, authorised, authorised (the 1st authorised was set by Paypal and gives a non functioning link. The second was updated manually and then give a functioning download link).

 

Ive added a free test download. The status went straight to authorised and the download link worked fine. Also as a test, I then set cheque mod (check) to give the status authorised aswell. After the purchase, the download page also showed the download link and correct date.

 

Ive also tried setting the Downloads Controller Order Status Value to 1 so it should allow everything to download which it did, but again no link after paying with Paypal or Nochex.

 

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

 

The only difference that I can see is the Paypal and nochex mods both 1st set the status to Paypal/ nochex processing and then automatically sets it to authorised when the payment is confirmed. Where as the other payment mods all only set the status to authorised (no changing). I think that download manager doesn't like the status being automatically changed. The why is the bit I don't understand.

 

Im sure if we all work together we will work this out.

 

Also, you may find this useful: https://developer.paypal.com/. You can setup dummy Paypal accounts to test with.

 

Regards

Andrew

Link to comment
Share on other sites

My store is working now. :D

 

Within download.php in modules I changed the following:

 

 

FROM:

 

$downloads_query = tep_db_query("select o.orders_status, date_format(o.last_modified, '%Y-%m-%d') as date_purchased_day, opd.download_maxdays, op.products_name, opd.orders_products_download_id, opd.orders_products_filename, opd.download_count, opd.download_maxdays from " . TABLE_ORDERS . " o, " . TABLE_ORDERS_PRODUCTS . " op, " . TABLE_ORDERS_PRODUCTS_DOWNLOAD . " opd where o.customers_id = '" . (int)$customer_id . "' and o.orders_status >= '" . DOWNLOADS_CONTROLLER_ORDERS_STATUS . "' and o.orders_id = '" . (int)$last_order . "' and o.orders_id = op.orders_id and op.orders_products_id = opd.orders_products_id and opd.orders_products_filename != ''");

 

 

 

TO:

 

$downloads_query = tep_db_query("select o.orders_status, date_format(o.date_purchased, '%Y-%m-%d') as date_purchased_day, opd.download_maxdays, op.products_name, opd.orders_products_download_id, opd.orders_products_filename, opd.download_count, opd.download_maxdays from " . TABLE_ORDERS . " o, " . TABLE_ORDERS_PRODUCTS . " op, " . TABLE_ORDERS_PRODUCTS_DOWNLOAD . " opd where o.customers_id = '" . (int)$customer_id . "' and o.orders_status >= '" . DOWNLOADS_CONTROLLER_ORDERS_STATUS . "' and o.orders_id = '" . (int)$last_order . "' and o.orders_id = op.orders_id and op.orders_products_id = opd.orders_products_id and opd.orders_products_filename != ''");

 

Its actually a very small change: Within the quiry I changed "o.last_modified" to "o.date_purchased".

 

Please note, Im not using Paypal shopping cart mod but the Paypal IPN mod "paypalipn_v0981_for_milestone_2"

 

Hope it works for everyone here aswell.

 

Cheers

Andrew

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