I using the latest cvs version of E-commerce on Drupal 4.7.1. My problem, users need to pay via paypal and get access to file download. But even after successful transaction payment status is pending, i need to manually change to complete. The IPIN mail shows the status is completed, but drupal still shows as pending.

Same problem is seen here.

Plz help me, how to get it fixed

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

sangamreddi’s picture

Does anyone having the same problem. I have searched the forums and issues tried some patches but no use.
Any help would be appreciated.

sime’s picture

sangamreddi

I'll let you know if I have the same problem, I'm about to set up something similar.

sangamreddi’s picture

Thanks for the response, the problem is only with paypal, i tried with another
gateway and cod, everything is working fine.

ñull’s picture

Is this a sandbox test in Paypal? Please have a look here: http://drupal.org/node/50312

ñull’s picture

Looks like you did not read the answers. You must be using the localised Drupal and ran into localisation errors. Did you apply the related patches?

sangamreddi’s picture

Thank you René Nieuwburg. Yes i am using Paypal Sandbox, i am not using any localised version, i am using the default Drupal 4.7.1 with ecommerce enabled.

Paypal Sandbox IPIN patch has been commited.

Everything is fine, except, the workflow status is not completed and it is pending, even after successful transaction.

The IPIN debug mail returns the status completed, but still the workflow of the transaction as pending for non-shippable items(file dowloads and subscriptions).

But on Drupal 4.6 and Ecom 4.6 worked as expected. The problem comes with Drupal 4.7 and ecom cvs.

gordon’s picture

Have you turned out the debug? Can you please post the output of this.

I have taken a look, and it looks like the status that is being past from paypal is not valid, and it is not picking it up.

Gordon

sangamreddi’s picture

FileSize
808 bytes

Thank you Gordon. I have attatched the paypal IPN debug mail. What i observed is same, the result from the paypal is not being passed to drupal and the default status pending is being recorded. I have no ideas how to make it work. Point me in the right direction.

Once again thank you.

judah’s picture

I have had this same problem and it has existed since version 4.5. I have recently updated to 4.6 and it still exists. The IPN from paypal is valid but the transaction status and payment status are never moved to complete. It is the same as sangamreddi says.

judah’s picture

A thought just occured. I checked and i have two emails associated with the same Paypal account. In the debug report paypal is sending back to the first email and not the one that I am have entered in the Settings > Paypal page. I cannot change the email in my paypal account so I have changed this on the drupal side. This may be the problem but I will have to wait until I get an order in to see if that is it.

sangamreddi’s picture

I dont think the problem is with paypal email, I noticed the email problem with paypal subscriptions module and not with paypal module. you can use primary email or any additional email.

I'll test on Drupal 4.6 to see whether the payment status is moving to completed or not. Last month i did a project on file downloads (Drupal 4.6) and the paypal worked as expected. I'll post the same by end of the day.

sangamreddi’s picture

On reading Judah's post i gaev a try on drupal 4.6. I got the same problem. Does paypal people changed anything?

rickvug’s picture

This is just a message for my tracker. This is one of the last two bugs affecting me... nice work.

lunas’s picture

for my tracker as well...

judah’s picture

I don't know what this tracker stuff is but I added some more debug messages to the paypal.module (version 4.6) and made a diff file. It should still work with newer versions 4.7 but you can apply it by hand if any issues come up. It worked and helped me figure out the issue.

Apply this and run through the checkout process (or wait for an order). You should receive a debug email with a lot more info. It adds a new condition that tells you if you're emails are valid or conflicting which was the case for me. Plus it tells you how far you've gone in IPN function.

judah’s picture

After looking at that diff file I'm including my modified paypal.module. It would be easier to do a comparison against the 4.7 version with a tool like examdiff if the 4.7 version has changed at all.

Note: When i attached the file it said, "A file already exists, if you upload another file the current file will be replaced.". It said this before with the diff file I attached but that was still attached so, crossing fingers, that this gets attached.

sangamreddi’s picture

I found the problem with this strcmp ($res, 'VERIFIED') == 0 if i remove this, everything si working. I Think the paypal isn't sending IPIN 'VERIFIED' atleast in sandbox mode. I'll test on other server and with different sandbox account and post teh same.

krahe’s picture

Version: master » 4.6.x-1.x-dev
Assigned: Unassigned » krahe

Hello, I have also a problem with paypal. in eCom 4.6 the status will be also as pending when I sell file products. Any patches or something. I don't use the paypal sandbox. I also don't get debug results. Whats wrong. Is that my fault or do i need a patch?

When i am not paying with paypal, or have a product with 0$ everything works fine.

sangamreddi’s picture

The problem seems to be with paypal people. Paypal isnt sending 'VERIFIED'. Chekc the paypal module at line 233 if I remove this strcmp ($res, 'VERIFIED') == 0 && everything is working well. But it is not recomended at all. Still i dint get any other clue than this. I tried with two different accounts, i got the same problem, paypal isnt sending a valid return.

krahe’s picture

hi, thanks, but my file products are still "pending". and the workflow ist still "transaction received". I don't know, what i am doing wrong. Any hints?

ñull’s picture

Paypal isnt sending 'VERIFIED'. I tried with two different accounts, i got the same problem, paypal isnt sending a valid return.

I don't agree that this would be the cause. I have set up drupal on a life website with ecommerce and using paypal.module. Payment status is set to completed without removing this strcmp.

ñull’s picture

Let's define terms again. What is the problem? Payment status remains pending? Or transaction status remains pending. The title of this issue is not correct because you wrote:

Everything is fine, except, the workflow status is not completed and it is pending, even after successful transaction.
The IPIN debug mail returns the status completed, but still the workflow of the transaction as pending for non-shippable items(file dowloads and subscriptions).

So if I understand right Payment status is set to completed. Right? But you have unshippable items and transactions status remains pending. Right?.

If that is the case, it has little to do with Paypal module. There is some code that refers to unshippable items that sets the workflow to completed, but i.m.h.o. I don't think that belongs in Paypal. For instance authorize.net, worldpay, paypalpro none of the other payment modules have that code. In fact I presented a patch many months ago to just remove that code from paypal.module. It never made it to be submitted to code because it would be necessary for unshippable items. I don't agree with that though, because the same functionality can be found in cron code of the store.module!! I would say this check in a payment module is just obsolete. Every cron event it will be dealt with automatically.

If you have a unshippable transaction that remains pending, most likely the problem is in the function product_is_shippable. In all ocasions this function is the one that determines if the transaction is shippable.

judah’s picture

I looked into this and figured out the solution for me. Paypal sends back the primary email of the account. That email has to match the email in the paypal module. If that does not match the status and transaction status will not move to complete.

But it sounds as if the ipn page is not even getting called. Make sure you have enabled the IPN in your paypal account. Log into paypal and check the email address on the my account page first. Write it down. Next goto Profile > Instant Payment Notification. Turn this on and enter the ipn url. This can be found in drupal at admin/settings/paypal. Do the IPN's match? Do the emails match?

I'm all for consolodating code but I do not think we should remove that code from the paypal module yet. I don't think a patch will get approved until we get things nailed down with this. The other reason I'm hesitant is that I looked at it briefly and the logic looks different than in the paypal ipn function.

Also, krahe, are you running a cron tab? Run an order, or next to you get an order call the cron.php page. http://www.krahessite.com/cron.php. If that moves your transaction and paypal status forward then we have more information to figure this out.

krahe’s picture

Ok. You are all right, I am a DAU = stupid user. I checked judahs hint and everything is fine. So next thing i will do is to test wether it also runs with strcmp ($res, 'VERIFIED') == 0 &&. After that I will donate and write this into the handbook: How to Set up a PayPal Account for the eCommerce Module. Currently it runs on my site. I don't know if the cron.php job work, but I think i will do. Guys I am happy - thanks a lot!

sangamreddi’s picture

For file downloads and membership the pament status has to be completed if paypal return status completed. IPIN retun status completed, but still drupal recording as pending and trasaction received.

just to note both emails are same, the email in paypal module is teh same email (primary paypal email).
Even it worked worked for me on one of my clients until couple of days back 1 month ago, suddenly it stopped working and the payment status pending for one of my client on drupal 4.6. While i am working on anotehr project i gto teh same problem with 4.7 too.

After lot of tail and errors, i found that if I remove this strcmp ($res, 'VERIFIED') == 0 && its working. i thought paypal is not returning 'verified'. when i remove the string comparison part everything is working well. you cna even see my IPIN debug mail in my previous comments for more information.

judah’s picture

sangamreddi and krahe,

i think i might have found something. what country are you in? when the paypal_ipn function is run it gets posted information from paypal. then the paypal_ipn function sends that same information back to paypal and then paypal sends back the result, either verified or not. thats what seems to be happening. the problem maybe that the post is getting sent back to www.paypal.com. if you are in another country then paypal url maybe different??? are you both outside of the US or are the accounts setup outside the US?

  $fp = fsockopen('www.paypal.com', 80, $errno, $errstr, 30);

that line is in that function. the results from posting to the are returned to the $res object. so, if its posting to the wrong url then its not going to send back "verified".

not sure how to fix it. maybe we make that a field we can set in the paypal settings page.

ñull’s picture

not sure how to fix it. maybe we make that a field we can set in the paypal settings page.

You cannot do a proper sandbox test either because of this hardcoded URI. That's why I made a patch with contributions and testing of others. You can find it here: http://drupal.org/node/50312

ñull’s picture

b.t.w. it should be included in CVS and 4.7 already

sangamreddi’s picture

Hi Judah, I not from US and my clients are from UK. I hope for US people they're not getting any problem with paypal, as we're not from US, so the problem for us.

com2, i got this problem on both 4.6 and 4.7 versions.

Anyway thanks Judah for sharing the info..

mo6’s picture

Version: 4.6.x-1.x-dev » 4.7.x-1.x-dev
Component: paypal.module » paypal

I've been struggling with the paypal module and encountered problems like described above: IPN is hit but the payment status never progresses to "payment received". It seems that the callback from the paypal module somehow isn't working and the fsockopen (see #26) just hangs the module. The reason is that on my hosting platform php is running in safe_mode which prevents fsockopen from working, which in turn refuses the callback to work.

mo6’s picture

In regards to my problem with fsockopen I discovered that there is a problem with php 4.3.4 on systems with ulimit (max. filedescriptors) larger than 1024. Upgrading php should fix the issue with a hanging fsockopen.

Darren Oh’s picture

I would like to add this observation to the discussion: it's not a good idea to use the CVS version of the PayPal module with Drupal 4.7. CVS is being updated for the next version of Drupal. Use the 4.7 branch. I have not experienced any of these problems on my test site.

Darren Oh’s picture

Misprint: I meant it's not a good idea to use the CVS version of E-Commerce with Drupal 4.7. Some E-Commerce modules that are only available in CVS may be usable with patches.

ryanrain’s picture

same problem...

the transaction is listed as pending whether or not the user completes the paypal payment process.

not sure how to help diagnose here since i'm not a coder. i'm running the most recent 4.7 ecommerce modules on php 4.4.2 with safe mode off. adding this to my tracker too...

thank you everyone!
-r

lukaso’s picture

This is working properly for me. One tip that might help: because I was international, in paypal's sandbox, I requested that I approve payments that are converted to a different currency, so all my payments were in fact pending. Once I switch that and approved all the payments, the status in drupal e-commerce was coorect.

I'm using 4.7 of the modules.

Another issue: the IPN address that was coming back in the settings dialog was incorrect due to some bad interaction with my base_url (I've logged a related bug). Make sure the IPN address returns a blank page rather than an object not found.

Darren Oh’s picture

Title: Payment status is always pending with paypal » Documentation Needed for PayPal IPN Set-up
Category: bug » task

There are really no bugs in this issue. Every problem has to do with PayPal or PHP settings rather than Drupal code:

#23 PayPal account settings
#26 PayPal URL
#30 PHP settings
#31 PHP version

What we need is clear documentation for setting up a PayPal account and Drupal site to work together.

ryanrain’s picture

yes, i'm sorry, i just hadn't set up my paypal account to send IPN notifications to my drupal installation. works perfectly.

brmassa’s picture

Status: Active » Fixed
Anonymous’s picture

Status: Fixed » Closed (fixed)