Buyers of downloadable products, paying with PayPal, get emails twice
| Project: | Ubercart |
| Version: | 6.x-2.0 |
| Component: | Code |
| Category: | support request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed |
Jump to:
Problem: Buyers of downloadable products, paying with PayPal, get emails twice
I am using Ubercart 6.x-2.0-rc7, the included uc_file module, the included paypal payment gateway module and Drupal 6.14.
In my shop, there is only one product sold. It is a downloadable product.
If someone buys this downloadable product once and pays with PayPal (PayPal Website Payments Standard), he gets:
- 2 emails "Your order at ..."
- 2 emails "Download link"
- in his account, the download is shown only once, but the customer gets two times the download and address-limits (6 instead of 3 downloads, ...)
The logs show the following:
27.09.2009 7:32:18 PM
User can now download the file Test_123.doc.
27.09.2009 7:32:18 PM
PayPal IPN reported a payment of 29,95 EUR.
27.09.2009 7:32:24 PM
User can now download the file Test_123.doc.
27.09.2009 7:32:24 PM
Order created through website.> This only happens with the Paypal payment gateway. The Creditcard payment gateway works correct.
Any ideas?

#1
Up again...
Are there others that have the same problem with paypal, or is it a problem with my system / other modules on my system.
#2
I have similar problem, here is log:
I have most recent version of ubercart 2.x and use paypal pro for checkout. When people stay on the website and pay with credit card everything is fine.
But when people pay with paypal, then I get 2 email notificatoins and the stock level is reduced twice.
Here is sample order log
10/05/2009
4:15:52 PM - The stock level for gear-snug-harness-red-4 has been decreased to 5.
10/05/2009
4:15:52 PM - Order created through website.
10/05/2009
4:15:58 PM - The stock level for gear-snug-harness-red-4 has been decreased to 4.
10/05/2009
4:15:58 PM - PayPal IPN reported a payment of 36.25 USD.
Here is sample log for credit card payment
10/04/2009
1:02:14 PM 1130 Authorize and capture immediately
Success: 38.24 USD
Address: Address and postal code matched
CVV2: Match
10/04/2009
1:02:15 PM - The stock level for gear-snug-harness-red-5 has been decreased to 1.
10/04/2009
1:02:15 PM - Order created through website.
#3
I had this problem before, too, and I think the solution was simply to add a condition to check to see if a payment has already been logged for the order before sending out the e-mail. Since this isn't a bug in Ubercart per se, but a compatibility issue w/ PayPal sending dual payment notifications (at the point of payment and later through the IPN), I'm going to defer this to the Ubercart.org forums for follow-up support. I know we've addressed it there in the past.
#4
> add a condition to check to see if a payment has already been logged for the order before sending out the e-mail
How ? Could you explain for drupal beginners like me ?
#5
I'd have to refer you to the support forums on Ubercart.org. I don't remember the thread, but I know this has been discussed. Search there is pretty darn good. : ) (We don't do support through the issue tracker on d.o.)
#6
I had a search for the aforementioned thread by rszrama on the Ubercart forums but could only find the two following threads that seemed relevant:
http://www.ubercart.org/forum/support/10422/multiple_emails_single_purchase
http://www.ubercart.org/forum/bug_reports/13313/paypal_duplicate_actions...
Both of which have been around for quite some time (one started in April :O) without being resolved. I am currently looking through the module code to see if there are any abnormalities causing the issue. Hopefully the more experienced guys can get on board this problem because right now PayPal and Ubercart RC7 cannot be used together on a production site.
Jason
#7
Ok here are some things I have tested but can't seem to put my finger on the problem.
Duplicate notification emails are sent when a user clicks on the Return to Store Button after completing a PayPal payment.
Emails regarding roles are sent twice upon completing a PayPal payment no matter what.
This leads me to believe that the order status is being updated to complete twice with PayPal. Here is why... Checkout notifications are run prior to the status being updated to complete. Role notifications are run after the status is updated to complete.
However clicking the "Return to Store" button triggers the checkout notifications again somehow. That is what puzzles me right now.
#8
It's because of the way the payment is being reported upon return and separately in an IPN from PayPal. Hence my suggestion to alter your CA predicates to check the order status or something to avoid sending the notifications the second time. I still need to point you back to Ubercart.org for support, though. There are plenty of people there who can help you configure predicates if you describe the issue and say "Ryan said I need to do something like 'this'."
#9
Thanks for the reply rszama. I think many people use the Drupal.org forum because it has a bigger following than the Ubercart one. Sometimes it helps to get input from the Drupal forums because not everyone visits the Ubercart forums as frequently.
I have to apologize for grouping my role notification issue with the checkout notification issue. I was granting the customer two roles but only wanted to send one email notification. It turns out using product kit with multiple roles requires that I set a conditional action to email that particular role as well as tell it not to email any other role.
In regards to altering the CA predicates to avoid sending notifications the second time, I believe the problem is caused by triggering the same order status. Therefore no matter what I set the order status condition to, it will always trigger the predicate or never trigger it at all. The trigger needs to be limited to one successful trigger of the predicate and then cease to fire.
Currently I see no conditional action that would solve this and only hard coding the module or adding a php input would solve this. I have looked around the forums and could only find the threads I mentioned above. I could have opened a new thread about the same problem on the Ubercart forums but thought that would just make it harder for the problem to be solved. Hence I have been replying to the existing threads in the hope that we can kick start some solutions.
Jason
#10
I fixed it by adding the condition "Condition: Check the order balance" and making it "Balance is less than or equal to $0.00."
I don't think this will create any problems with other payment methods.
#11
Thank you, agilpwc! It stops sending email twice!
#12
Automatically closed -- issue fixed for 2 weeks with no activity.
#13
Hm, you shouldn't really do that if you're using other payment methods than PayPal/ClickandBuy though, as check, direct debit and all those will change the account balance way after those mails should be sent or am I misunderstanding?
(For me this is occuring with "normal" non downloadable products)