Hi,

I'm using this module with PayPal WPS, and repeatedly the webform component for payment status wasn't getting updated. I added an extra action to Mark Event Registrations as Paid that sent an email to me, and it didn't fire either, leading me to believe the problem was with the conditions. I set up an email that was sent on Customer completes checkout and included both the order number and order status. It clearly showed that the status at that point was In checkout. I removed the condition that the order status be Payment received and sure enough it started working.

I'm a bit wary though, as presumably it's been working for plenty of other people. I read on one of the issues you saying that it hadn't been tested on WPS, but I wouldn't have thought it would've made a difference to order status updates. I haven't added/edited the conditional actions from the default. I do have the action Update order status on full payment that should set the status to Payment received. Maybe the trigger A payment gets entered for an order is getting fired after Customer completes checkout? (Seems weird if so.)

Does any of this make any sense to you? Do you see any problem if I remove the status check from your conditional action? (It still checks the balance, so that should be ok, no?)

Btw I'm using 1.1, but I checked that there was no change to the conditional action in 1.2, so I presume that's not it either...

Thanks for your time,

Andy

Comments

Rob_Feature’s picture

Title: Conditional action 'Mark Event Registrations as Paid' doesn't run » 'Customer Completes Checkout' not firing with WPS
Project: Ubercart Event Registration » Ubercart
Version: 6.x-1.1 » 6.x-2.x-dev
Component: Main Module » Cart/checkout

The conditional action used in uc_event_registration is literally pulled from ubercart itself (as one of it's core conditions) so if that's not firing it's an ubercart issue with WPS, not related exactly to this module.

Retitling and assigning to ubercart queue. If it turns out that it IS something related to this module, feel free to reassign it back here.

longwave’s picture

"Customer completes checkout" actually gets fired twice on some WPS setups, once when the user returns from PayPal and once when the IPN is received from PayPal - this is the cause of #644538: Duplicate order notification e-mail, and duplicate stock decrement.

Maybe the trigger A payment gets entered for an order is getting fired after Customer completes checkout?

I think this can happen in either order when using PayPal WPS, as the payment is only entered when the IPN is received (which could be instantly, or could take several minutes/hours in some cases), but the customer completes checkout when they click to return from PayPal (which could happen before or after the IPN, or in fact may not occur at all if the user closes their browser on the last PayPal page).

AndyF’s picture

Project: Ubercart » Ubercart Event Registration
Version: 6.x-2.x-dev » 6.x-1.1
Component: Cart/checkout » Main Module

Thanks Rob_Feature, longwave.

The conditional action used in uc_event_registration is literally pulled from ubercart itself (as one of it's core conditions) so if that's not firing it's an ubercart issue

The trigger is firing, the problem is that one of the conditions on Mark Event Registrations as Paid isn't met, so I think that makes it a uc_event_registration issue.

If I understand longwave correctly, then this could be an explanation for the problem, and why it doesn't occur with Payments Pro.

Problem

  1. With WPP you never leave the site, and you are guaranteed that A payment gets entered for an order is fired before Customer completes checkout. (Is this right?)
  2. This means that with WPP the payment status will always be Payment received, which means the conditional action Mark Event Registrations as Paid will have its conditions met and will fire its action.
  3. If you use WPS then it's likely that the order of triggers firing will be reversed. In which case the status hasn't yet been set to Payment received. This means one of the conditions for Mark Event Registrations as Paid isn't met, and that's why the action isn't fired.

Solution

  • Remove the order status condition from Mark Event Registrations as Paid.
  • Attach Mark Event Registrations as Paid to the trigger A payment gets entered for an order and ensure it's heavier than Update order status on full payment.

I'm not sure which approach is better. Any ideas?

AndyF’s picture

@longwave Rereading your post I'm a bit confused about the trigger Customer completes checkout: is it guaranteed to fire if payment is made? The first part of your comment implies to me yes, and the second no!

"Customer completes checkout" actually gets fired twice on some WPS setups, once when the user returns from PayPal and once when the IPN is received from PayPal
...
the customer completes checkout when they click to return from PayPal (which could happen before or after the IPN, or in fact may not occur at all

Thanks for your help!

Andy

longwave’s picture

It is fired on both the events I mentioned and for most orders will be fired at least once (when the IPN arrives), but there can be unusual cases where both the user does not click to return from PayPal, and PayPal's side fails in some way so the IPN is not received. This has been reported to occur (rarely) on the Ubercart forums, more often with the sandbox but I believe it has occured on live from time to time. If the IPN is not received you have further problems, as you have no way of knowing that payment was actually made.

longwave’s picture

As the predicate is called "Mark event registrations as paid", perhaps it would be better to fire it on "order status gets updated" to "payment received" and/or "completed", as payment is not necessarily received when the user completes checkout.

With PayPal WPS, if the user pays by eCheck, it does not clear for several days, and may in fact bounce - so you probably don't want to mark these as paid until you receive confirmation of funds.

Rob_Feature’s picture

Status: Active » Postponed

This requires actually writing our own conditional action :) I wasn't up to it at the time so I used what was in ubercart core. If anyone wants to write a CA to handle this case, that would be great. Marking as postponed because I can't envision doing it soon. For now, you can just change it manually in the CA settings, right?

AndyF’s picture

Status: Postponed » Active

@longwave, that's fantastic, thanks a lot.

@Rob_Feature would you be willing to change the trigger to Order status gets updated and I think we could then leave the two conditions as they are?

Thanks

AndyF’s picture

Status: Active » Postponed

Oops, sorry!

AndyF’s picture

@Rob_Feature can't you just change '#trigger' => 'uc_checkout_complete', to '#trigger' => 'uc_order_status_update', in uc_event_registration_ca.inc?

Rob_Feature’s picture

If there's a core trigger for this we can do that...I didn't realize it was already there. I'll get this into the dev release for testing. (please test on your own and confirm that works with WPS)

AndyF’s picture

Status: Postponed » Needs review

Thanks Rob_Feature, I'll do that and let you know if it works.

ChrisLaFrancis’s picture

Status: Needs review » Postponed

Subscribing.

ChrisLaFrancis’s picture

Status: Postponed » Needs review

Sorry, just realized I changed the status.

AndyF’s picture

Seems to be working fine for me with WPS.

AndyF’s picture

I've had this running a while now and it seems to work without a problem, but I haven't tested it with WPP. Would be great if someone could do that and mark this RTBC!

Rob_Feature’s picture

Yeah, we probably have to have this confirmed by other payment services, such as Authorize.net Can anyone test this change in conditional action with a different payment service?

Rob_Feature’s picture

This change is added to the development version (April 18, 2011) please test.

virtualgirl’s picture

whats the status of your mission?
here are the issues we are dealing with
Cannot get the file download to work in uc2.4dev or uc2.4 usinf cc processing though wps website payments standard for cc processing and pp transactions

1. "in checkout" means user did not return to the site even though they paid at paypal
2. do come back , i.e.clicked the return to site linkat paypal , but now registered as "pending" status
*****************BUT
4. doesnt matter b/c payment is not getting entered in uc order system
5. no triggers can work to the file dl because the balance is still >0

Any assistance is quite welcome and is time sensitive. I hope this post assists
dear torgos pizza, were you able to write a conditional to override this?

A conditional action was added and ten removed do to not working to the file downloads trigger but it wont take anyway because of the payment not being entered.

AndyF’s picture

Hi lmfisher100,

I don't understand all of your details. Can I confirm that the order status is never updated to Payment received? If so, then the issue lies with Ubercart (or its configuration) rather than this module. UC WPS waits for PayPal's IPN to mark the order as Payment received: that would be the first place I'd look. Some ideas:

  • Ensure your site is reachable by the PayPal servers (ie if behind a firewall, it must be correctly configured, etc.).
  • You can turn on IPN debugging and check the logs.
  • You can manually configure the IPN address in the PayPal account settings. The correct address is site_base_path/uc_paypal/ipn.
  • If you're using boost, you'll want to ensure that the path above is excluded!

hth

AndyF’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

ktf’s picture

This bug --or something very similar -- still exists for me. If a user pays with paypal but does NOT click "return to [blah]" after paying, the "customer completes" checkout trigger is not fired and no emails are sent.

Interestingly, the IPN is received and the order is updated to "payment received". Still, no invoice sent to customer, no admin email sent.

Also interesting: when the order includes purchased files, the "renew purchased files" trigger IS fired once payment is received, and the user gets access to the files. However, the user is NOT notified via email that the file was granted. This is especially mysterious to me because there is a hard-coded call to ca_pull_trigger('uc_file_notify_grant', $order, $user_downloads); at the end of
uc_file_actions_order_renew() in uc_file.ca.inc.

All other order cases are working great.

AndyF’s picture

Hi,

This sounds like you're having a general issue with your Ubercart setup, rather than with Ubercart Event Registration (certainly UCER isn't responsible for triggering Customer completes checkout). I'd recommend searching the Ubercart issue queue and raising an issue there if one doesn't already exist.

Thanks