Let me start by saying thank you. I've been looking for a module like this, and this module shows a lot of promise.

SYMPTOM

After a user returns to the Drupal site's thank you page from Paypal, the URL for the Download your quickfile link is sometimes missing the transaction ID.

A good link will end with something like .../quickfile/download/207/406

An incorrect link will end with something like .../quickfile/download//406

CAUSE

Sometimes, function quickfile_link() is not finding the transaction ID in the {quickfile_transaction} table because function quickfile_paypal_ipn() has not finished execution and the transaction record hasn't yet been inserted into the database.

This situation might arise more frequently in environments where database and web servers run on separate machines because there are more variables that can affect timing of code execution (e.g., network traffic, server load, etc.)

POSSIBLE SOLUTIONS

Here are a few options. There may be others.

1) Have quickfile_link() allow more time for quickfile_paypal_ipn() to finish execution
2) Streamline quickfile_paypal_ipn() code so it takes less time to execute
3) Display a "try again" page if the transaction is still in progress
4) Change the download URL format so it uses the payment processor's transaction ID rather than quickfile's transaction ID

Personally, I think a combination of 3 and 4 might be best. Option 4 allows more time for function quickfile_paypal_ipn() to complete while the user is reading the thank you page. Option 3 gracefully handles the unlikely situation where a fast user somehow still finishes ahead of function quickfile_paypal_ipn().

Another (unrelated) reason why option 3 is a good idea -- using payment processor's transaction ID is a little more secure because it's harder to guess than the sequentually issued drupal IDs. A combination of payment processor's transaction ID and user's email address would seem to be ideal for paypal transactions :)

I'm relatively new to Drupal, and I don't have any experience with CVS, but I may be able to help some with coding a patch if you know what approach you want to take to fix the design issue.

JM

Comments

alexis’s picture

Assigned: Unassigned » alexis

Hi, thank you for your very helpful suggestions.

I will take a look at this because many are reporting problems with Paypal and will contact you if I need to make some tests. I hope that's ok.

Regards!

jm9’s picture

Title: function quickfile_link() generates an improper download URL » I jumped the gun a little bit

I found an example where function quickfile_paypal_ipn() never did insert a record for one of my test transactions, so the cause may be something other than a timing issue.

Sorry (red faced)

JM

jm9’s picture

Title: I jumped the gun a little bit » function quickfile_paypal_ipn may not insert transaction record

(still red faced)

I just learned that changing the title on an issue reply changes it for the whole issue.

JM

jm9’s picture

Last post for me tonight. (I'm clearly too tired to think as carefully as I need to.)

It turns out the reason no transaction record was posted in my #2 reply is because I forgot to put my test site back online before running another test case.

Results from my earlier tests all point to a timing issue. I am still convinced this is a timing issue.

JM

jm9’s picture

Title: function quickfile_paypal_ipn may not insert transaction record » function quickfile_link() generates an improper download URL
Priority: Critical » Normal

... now better rested and fully alert :)

Thanks alexis. I am happy to help with testing, and I can also provide you with access to my test environment.

Quickfile is a *much* better solution than what I'm currently using , so I'm very eager to assist.

Here are some more details that may be helpful:

I have a test site setup in a shared hosting envornment. The web server and database server are on separate machines. The test environment is connected to the Paypal sandbox and running with Quickfile's Paypal sandbox mode enabled.

The bad URL results seem to happen sporadically, but it's usually pretty easy to reproduce the problem by running the same scenario a few times. When the problem appears, I am always able to get correct results by telling my browser to refresh a few seconds later. From what I've seen in the code, this "refresh" observation is key to my conclusion that the problem is caused by a timing issue.

** If you're interested, I'd be happy to write some code that uses the payment processor's transaction ID in the download link (and could be used as part of the fix).

OFF TOPIC -- I plan to modify the standard release to allow users 3 downloads of the same file within 30 days. This is why I'm kind of pushing to use the payment processor's transaction ID to make the download link a little more secure. :)

Since I'm not yet using this is in production, I'm downgrading the priority to normal.

Thanks again,

JM

alexis’s picture

Hi, thank you for your ideas.

I'm coding right now and will use option # 4, it's the clear winner, using the Paypal transaction ID.

Once I have the code fixed I'll let you know so we can test in your environment, I saw this error a few times but then I was unable to reproduce it. ¿Any suggestions for reproducing it? :)

Cheers.

jm9’s picture

Thanks alexis

It's been pretty easy to reproduce in my environment this week. I think load and configuration of servers has a lot to do with it, as these factors affect execution times. My test setup is in a cheap shared host environment, so that probably helps with reproducing the problem :)

I'm available 12/20 & 12/21 to assist with testing. Sending an email via the contact form in my profile is the quickest way to get my attention.

JM

alexis’s picture

Status: Active » Postponed (maintainer needs more info)

Hi, I've just updated the Paypal code in Quickfile for Drupal 4.7 and 5.0 and commited to CVS.

Please download it, test it and let me know if you're still having problems with Paypal orders.

I'm still keeping status as active until confirming everything is working now.

Regards!

rcutz’s picture

Hi Guys, I`m new here and I was trying to setup my quickfile.

My main issue is releated to paypal setup.
I`m returning from paypal page, after completing the payment but I can`t get a link to download.
I return to my previous setuped "Thank you Page" but the dowload link did not shows up.
I receive a email a with a link but it don`t work.
It send`s back me to my "Thank you" page without link again.

this is the link I get on my email :

but /node/5 is my thank you URL.

The Thank you page, must be blank? or it can have a message?

I was doing all my tests with a real enviroment. I follow this thread and that other http://drupal.org/node/101099
and nothing to it work...

I hope someone could help me

duaelfr’s picture

Status: Postponed (maintainer needs more info) » Closed (won't fix)

This version of Quickfile is not supported anymore. The issue is closed for this reason.
Please upgrade to a supported version and feel free to reopen the issue on the new version if applicable.

This issue has been automagically closed by a script.