hi Guys,

I'm creating this thread to take discussions about setting up the quickfile.module that are continuing in a closed issue

rtdean93

What should be my IPN Url? Currently it is http://www.gignetsolutions.com/quickfile_paypal/ipn

Yep, it looks like you have the correct paypal IPN.

Here are the steps I used when I was setting up paypal payments (I have tried it with both the 4.7 and 5-dev versions) :

  1. Login to your paypal account.
  2. Click on Profile
  3. Click on Website Payment Preferences
  4. Under Auto Return for Website Payments switch on auto-return and make sure your IPN Url matches what the quickfile module indicates under ADMIN -> QUICKFILES -> PAYPAL
  5. Under Payment Data Transfer (optional) select ON
  6. Save those changes. When the confirmation screen appears you shuold see a very long list of letters and numbers. That's your PDT token that you need to put into the quickfile module settings page

Once that is done, the module worked for me. I'm not sure if the PDT token is necessary, but, the above worked for me.

Phil

Comments

rtdean93’s picture

I now have it working. Looks like was the directory configuration which was my problem & a problem writing the IPNs to the database. A fresh install fixed everything.

dhw1179’s picture

"I don't think Firefox is the problem here. Many of my clients use Firefox and they've been able to buy many ebooks from my sites using Paypal.

It's a little difficult to track this issue but I saw it happening a few times until I added a "echo" or "print" command, outputting anything before the download link. Finally I noticed that just asigning a variable to itself made the problem disappear.

Try printing something before the download link in your thank you page, for example: print 'test', and let us know."

I'm not quite sure I follow what you mean here. Should the echo or print command go in the node or in the module coding? I tried IE and still the same problem, not a Firefox issue. All the links (email and transactions) work except for the one provided directly after returning from paypal. I tried recopying all the files and recreating the mysql tables to ensure everything was ok. I've checked all the paypal settings and everything matches. Not sure what to do now...

DHW

Chill35’s picture

I found a way to provide to the quickfile module a relative path to a folder outside my Drupal folder, a way that works really well.

Directory for quickfiles:
../PrivateFolder

Now you only need to enter the name of the file with its extension as "path to quickfile" when you create a quickfile, as long as this file has been 'put' in the PrivateFolder directory.

Here is my setup on my compute :

f:/htdocs/PrivateFolder
f:/htdocs/Drupal-5

In other words, my Drupal Folder is on the same level as my Download folder.

By the way I am testing with Drupal 5 rc 1.

QUESTIONS :

  1. What do you mean, Phil, by Thank You or Error Downloading URL ? Can't I simply put node/5 in there after creating a Thank You page which has unique id '5' ? It does not seem to work for me.
  2. Are transactions of "zero dollars" supported right now ? I tried a transaction with a coupon where the file was "free" after discount. It doesn't work. When I get to the page where it states that it will cost me 0.00$ I am asked if I want to go to PayPal and make my purchase (which is bizarre) then I am lead to a page that does not exist inside Drupal. Can't remember which one. I know that e-commerce supports transactions where the bottomline amount to pay is zero dollars - it does that very well. I tried e-commerce with Drupal 4.7.
Dublin Drupaller’s picture

Hi Chill,

Not so sure about the freebie issue...There's an option on the quickfiles admin page to set the lowest value for a transaction but, you might need to add in a function to the module that does this;

Skip to the thank you page and don't bother with paypal/other 
  IF the value of the quickfile is 0.00 
    OR if the user has entered a discount voucher that brings the value below zero.

re: the private folder issue...how do you protect that /htdocs/PrivateFolder/ folder?
I thought that once you put a folder below the /htdocs/ folder it means it's accesible by anyone..and people can get/guess the links to your quickfiles using a download manager or guesswork.

I'm having problems setting up a folder ABOVE the httpdocs folder at the moment...I'm using a host that has a plesk control panel that doesn't allow you to create new folders Above the httpdocs folder, so, I'm a little stuck at the moment if there are any plesk wizards out there.

Dub

Currently in Switzerland working as an Application Developer with UBS Investment Bank...using Drupal 7 and lots of swiss chocolate

Chill35’s picture

re: the private folder issue...how do you protect that /htdocs/PrivateFolder/ folder?
I thought that once you put a folder below the /htdocs/ folder it means it's accesible by anyone..and people can get/guess the links to your quickfiles using a download manager or guesswork.

You are probably correct about this. I am just testing locally...

I prefer a relative path like the one I have because I won't have to change a thing when I move my site on a remote server : as long as I can create a directory on the same level of whatever folder I will have for "www" or "public", a directory to which I'll give that name.

"..\" means "going up one level".

Phillip Mc’s picture

try clicking on REFRESH when you're brought back to the THANK YOU page from PAYPAL. That's how I spotted it. I.e. when you bounce back from paypal after paying for the quickfile, the download link is partly empty, but, when you refresh the THANK YOU page the download link displays correctly. So inserting a <?php print $something; ?> instruction into the thank you page node (with php filter on) it avoids the browser spitting out the cached THANK YOU page.

phil

dhw1179’s picture

Tried both of those, link is still blank. I'll just tell my buyers to rely on the email link for now until I figure out why it refuses to work like it should.

jm9’s picture

I'm just starting to look at the code for this module, and I think some of these issues might be related to timing of code execution.

It seems the following events must happen in this order for everything to work correctly:

A1) Paypal sends PDT data to URL quickfile_paypal/ipn

A2) function quickfile_paypal_ipn() receives and verifies data from PayPal, inserts transaction data into the database

B1) User arrives at thank-you page (returning from PayPal)

B2) function quickfile_link() retrieves transaction data saved by A2 -- function quickfile_paypal_ipn()

The problem is that A2 could still be executing while B1/B2 are happening. If so, $txnid will be blank if B2 executes before A2 has finished inserting the paypal transaction record.

Pressing refresh in the browser causes B1/B2 to execute again, which usually allows enough time for A2 to finish inserting the transaction record.

Not coincidently, adding the PHP print statements and other contortions mentioned above may be delaying the execution of B2 just enough for A2 to finish inserting the transaction data; but this is obviously not a very reliable approach. Upgrade to a faster web server while keeping a slower database server, and your code might break again. :)

A somewhat better solution might be to have the B2 code wait a few seconds and try again if the transaction record is not found on the first check. Some sort of "waiting for Paypal transaction to complete" message might also be needed.

Also, there seem to be a few shortcuts in the code (like hard coding the PayPal transaction as complete). If the user has paid via eCheck, it may take several days for the transaction to clear.

JM

jm9’s picture

Another option might be to have the download URL include the payment processor's transaction ID rather than the quickfile transaction ID. This would allow time for function quickfile_paypal_ipn() to complete while the user is reading the screen and before they click on the download link.

... just half-baked idea that might turn out to work :)

JM

alexis’s picture

Following jmelby's ideas at this issue I've made some changes and have just commited new versions of Quickfile to CVS (for both 4.7 and 5.0), please update your Quickfile installation and retry with Paypal.

There are no changes in the tables, in fact, just the .module file changed, so you could just overwrite that file in your current installation.

Quickfile now uses Paypal's txnid instead of the autoincrement txnid in the quickfile_transaction table.

Help us testing it and let me know if it's working now.

Thank you very much to jmelby for proposing a fix and allowing me to test in his environment and to everybody else for your comments and ideas.

Alexis Bellido
Aprende a usar Drupal en menos de 48 horas

doka’s picture

I set up Quickfile as well as Paypal Sandbox, as proposed in this thread, thx for this staff.

At the beginning, the transactions are running well, in Sandbox every transaction is completed and OK. The thankyou page works fine, there is a download link displayed: http://www.example.com/quickfile/download/92C58513FY2815026/4/paypal

But the download does not work, the link brings me to the error page of Quickfile. And I do not see any transactions on Quickfile Transactions page. It states: "No transactions found".

Any idea what to check?

Doka

webmost’s picture

Doka

Don't know if you already resolved this. I find no answer here. I had the same exact error. Here's how I fixed it:

1) Edit quickfile.module line 241 change $txnid = $_GET['tx']; to read $txnid = $_GET['txn_id'];

2) Add a new line right after that: $nid = $_GET['item_number'];

3) comment out the next line beginning $customString etc. by putting // in front of it

4) Comment out the next line beginning $nid etc. the same way

5) Go to what is not line 261, beginning $links[]. Change the bit that says $base_url . '/quickfile to read $base_url . '/?q=quickfile

Worked for me. Hope it helps you.

Davis

danunez’s picture

I'm having the same error as doka...
"I set up Quickfile as well as Paypal Sandbox, as proposed in this thread, thx for this staff.

At the beginning, the transactions are running well, in Sandbox every transaction is completed and OK. The thankyou page works fine, there is a download link displayed: http://www.example.com/quickfile/download/92C58513FY2815026/4/paypal

But the download does not work, the link brings me to the error page of Quickfile. And I do not see any transactions on Quickfile Transactions page. It states: "No transactions found".

Any idea what to check?"

I have tried webmost suggestion, as well as setting $txnid = $txnid in the code, and echoing and printing before the link. safe urls are on, i have verified I'm using the right PDT token for my sandbox. I get the correct URL but when I click on the link I get redirected to the error page and the transactions aren't inserted in the database. Also, when I create a transaction manually it works, but when I try to access the download link through the manually created transaction I get the same thing, I get redirected to the error page. It's not a html/php ERROR page, rather the error we setup as part of the quickfile setup (just wanted to clear that up).

Any help would be greatly appreciated.

greygoo’s picture

Great module! Works fine testing on sandbox so far. I have two quick questions.

1) How do I change the "Pay using paypal" text link to an image (I'd like to use the paypal buy now button instead)?

2) How do I hide or disable the coupon feature and the 'news and promotions' checkbox since I'm not going to use them?

Thank you so much. Oh, and may I suggest changing the default download link text to read "Download your file" instead of "Download your quickfile"?

mmlr38’s picture

I have the quickfile module installed and I think it is pretty close to working, but the problem is that the download URL is completely empty. It looks like this: http://www.mysite.com/quickfile/download///

How is it that the information is passed back from PayPal so that the function quickfile_link($type, $node = null, $teaser = false) can have the data?

I took a look and this funciton is looking for a GET string with a couple of variables set, but there isn't a GET string at all when returning from PayPal. Here is what the function is looking for:
if (isset($_GET['tx']) && !isset($_GET['method'])) { // if coming from Paypal using PDT

Right now I have the IPN (Instant Pay Notification) through PayPal enabled and it is pointing to the URL http://www.mysite.com/quickfile_paypal/ipn

That seems to work fine because the {quickfile_transaction} table gets everything stored in it correctly.

I also have the Auto Return for Website Payments ON through PayPal with a return URL of:
http://www.mysite.com/thankyou

And I have the thankyou page set up with a little text on it. But when returned to the thankyou page, the download link is completely empty.

What am I doing wrong? Is there something that I need to change in the settings in PayPal?

Matt
Open eOrthopod
MixMap.com

mmlr38’s picture

I just more thoroughlly read through everything here: http://drupal.org/node/101099 and it seems like the processor_txnid in the {quickfile_transaction} table should be set to some string of numbers and letters like 37W439682U7071238, and that isn't happening. It is always 0. So, this makes me think that there must be something I am missing, but I have checked TONS of times to make sure that I have the PDT Token set correctly.

I have changed the Auto Return URL to the http://www.mysite.com/quickfile_paypal/ipn URL and it doesn't seem to have any affect.

Any ideas what I am doing wrong?

Matt
Open eOrthopod
MixMap.com

Quinti’s picture

I have the same problem

the only download link that run is the link of the email...

and i put print "cosa"; in the "gracias" page...
but the first time when come back from paypal the link is: http://www.domain.com/quickfile/download/%252F/

mm..

Alexis?
¿qué puede ser?

Quinti.net

robinwickens’s picture

Can I set a remote directory for file storage?

i.e. http://somewhere_off_my_server.com/directory/

rcutz’s picture

Hi Guys, I have been reading all posts releated to seting up quickfiles with paypal and I can`t get my
download Url, I have notice some of you guys have been edting the code fo quickfile.

Is possible to some of you help me to make it works?

I can return from paypal but I can`t get my download link.

thanks
ricardo

codenamerhubarb’s picture

Hi,

I have the same problem as rcutz, the PayPal transaction goes fine and the transaction table is filled with all the right data but when PayPal returns me to the thank you page I've created there is no link to download the file.

Is the download link supposed to be shown automatically after the body text of the thank you page?

Cheers,
Jake.

-------------------------------
My Drupal site: Download a Book.

-------------------------------
My Drupal site: Download a Book.

codenamerhubarb’s picture

I had to make my own download link on the thank you page by retrieving some parameters e.g:

echo "CLICK HERE TO DOWNLOAD YOUR EBOOK";

This gives you a nice link with the transaction id and item number in their rightful places. I hope this saves somebody some time and hassle because I wasted a couple of hours over this.

Cheers,
Jake.

-------------------------------
My Drupal site: Download a Book.

-------------------------------
My Drupal site: Download a Book.