Hello!
I seem to have a problem and can't find any posts or any further information, I'm hoping someone here can help.
I have anonymous checkout enabled. Which means ubercart creates a user with the email and information you insert during checkout.
In a few orders, customer accounts were created and I can see Ubercart/Drupal have assigned an ID to them "customer number" If they have this ID, the system can track the order status correctly (in progress, abanadoned, completed)
I can see the payment go through the Moneris hosted pay page gateway. Moneris replies "Completed" if the credit card is approved and returns us to the completed page. This works well and updates the order status to completed.
Problem is, on orders, even if I see the payment go through Moneris, the order status stays to "Abandoned". The ONLY thing that I could find that didnt make sense was the fact that no user account had been created for this order. In the "View customers" page I cant see the customer with the problem and in the invoice the customer has an id of 0.
Any ideas?
Thanks!
Comments
Comment #1
TR CreditAttribution: TR commentedTest to see if you can reproduce this with one of the core Ubercart payment methods, like check or test gateway. It's likely the problem is with the Moneris module, in which case your report should be moved to that queue.
Comment #2
voodoodan245730 CreditAttribution: voodoodan245730 commentedI will try to reproduce it for sure!
But I can see 2-3 payments that have gone through without any problems.
I don't see why the payment gateway would be the issue as no customer ID is being created.
I have 2-3 payments that have been completed with customer ID and everything and payment received at Moneris and I also have 2-3 orders that have been abandoned in Ubercart but have been completed in Moneris???
Many thanks!
Comment #3
TR CreditAttribution: TR commentedThe order isn't set to "Abandoned" unless the payment gateway fails to confirm the payment and set the status to "Payment received". If the payment isn't getting confirmed, or the user isn't getting created, that indicates that the payment gateway code is executing things in the wrong order (where it calls uc_cart_complete_sale(), in particular) or perhaps has buggy/incomplete code.
Comment #4
longwaveCan you try upgrading Ubercart to 7.x-3.x-dev and see if the issue goes away? Since 7.x-3.5 was released, #1597154: Some PayPal Standard Orders "Abandoned" even though payment is received was fixed, and if Moneris works in a similar way to PayPal - that is, it relies on a callback being sent to confirm the payment - then the same issue and fix might apply here.
Comment #5
voodoodan245730 CreditAttribution: voodoodan245730 commentedThank you for your suggestion, I will give this a try and report back!
The Moneris payment gateway module that is being used is one that was ported from Commerce to Ubercart. It works well but I just noticed this problem. It also relies on a callback to confirm the payment. If "some" paypal orders had this same issue then the dev version should fix it.
Here is the code for Callback of a completed order :
Many thanks!
Comment #6
longwaveDid upgrading to 7.x-3.x-dev solve this issue?
Comment #7
sigveio CreditAttribution: sigveio commentedJust a thought on this;
If it's a new user, who is not logged on,
uc_payment_enter()
would calluc_cart_complete_sale()
to make sure the account is created prior to entering the payment. However... since $order is not passed directly to uc_payment_enter() there is no reference to the original$order
object inuc_monerishpp_complete()
. This in turns means that the$order
object will not be up to date at the point whereuc_cart_complete_sale($order, TRUE)
is called to do the login... and$order->uid
would therefore be the default 0.If the above is correct... I would also think that it could potentially cause further trouble/unintended behaviour seeing asuc_cart_complete_sale()
relies on updated order data to safeguard against running the account creation and such more than once.(I missed the fact that $order->data is refreshed through a query in
uc_cart_complete_sale()
.)For an example uc_paypal manages to avoid this issue because it redirects to cart/checkout/complete after a completed sale. This in turn executes the menu callback uc_cart_checkout_complete() - which makes sure to reload the order before uc_cart_complete_sale() is ran again.
Might be worth looking into.
The quick-fix could potentially be to alter uc_monerishpp_complete() as follows:
(Note: uc_cart_empty() can be removed while you are at it... because uc_cart_complete_sale() will take care of this.)
I am not able to test this... so this is all theoretical of course.
Comment #8
longwaveThe above doesn't explain why it only happens for some orders and not all, which is why I thought it was the timing related issue fixed in #1597154: Some PayPal Standard Orders "Abandoned" even though payment is received. That's definitely another avenue to explore though if the 7.x-3.x-dev upgrade doesn't work here.
Comment #9
voodoodan245730 CreditAttribution: voodoodan245730 commentedThanks for you help everyone!
Upgrading to the Dev version did fix the issue.
However, after some extensive research, I'm not 100% sure that this was an Ubercart/Moneris payment module problem. I believe Moneris might of had some issues during these transactions and was not returning the correct response code. This is my conclusion as I cant reproduce the problem on the Dev or Recommended release version anymore.
Many thanks!
Comment #10
longwaveThanks for getting back to us :)
Comment #10.0
longwaveadded correct page