Some of my orders are showing up as "abandoned" even though payment has been reported as received from PayPal. I've turned on IPN log now to see if I can track down more information with future payments but was hoping for some help in the meantime. Some orders show up as "Payment Received" but still aren't marked complete but some just come in as abandoned. Below are two logs. Any ideas why this is happening?

Abandoned:

May 18 2012 - 1:17am	-	
Order status changed from In Checkout to Abandoned.
May 18 2012 - 10:13pm	-	
PayPal payment for $40.00 entered.

Payment Received: (manually marked as completed)

May 20 2012 - 10:09pm	-	
PayPal payment for $40.00 entered.
May 20 2012 - 10:09pm	-	
Order status changed from In Checkout to Pending.
May 20 2012 - 10:09pm	-	
Order status changed from Pending to Payment received.
May 23 2012 - 8:50am	jeggen	
Order status changed from Payment received to Completed.

PayPal is setup with the following:
IPN On and URL is http://www.bethanyelkhorn.org/uc_paypal/ipn
Auto Return On and set to: http://www.bethanyelkhorn.org/cart/checkout/complete
Payment Data Transfer: Off
Encrypted Website Payments: Off
Express Checkout Settings: Off

Ubercart Settings:
Website Payments Standard
PayPal Server: Live
Payment Action: Complete sale
Cancel return URL: http://bethanyelkhorn.org/cart
Submission Method: itemized (previously set to whole order)

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

longwave’s picture

Category: support » bug

Thank you for the detailed report.

For the abandoned case, the IPN appears to have arrived 21 hours late, which can occasionally happen with PayPal. Ideally Ubercart should move the "in checkout" order to "pending" to avoid this, but due to the way PayPal WPS works we cannot detect that the user has clicked "Submit order" unless they click back to the site after paying. Perhaps we should increase the abandonment timeout to deal with this.

For the payment received case, this is by design for orders with shippable products; it is meant for you to manually mark the order as "completed" when you have shipped it. You can change how this works by editing the default Rules.

jeggen’s picture

Regarding the payment received case. The product is not configured as a shippable product.

Here is the complete checkout for non-shippable order rule as it is configured on my system. Should be stock but thought I'd include it in case something is in error here.

{ "uc_checkout_complete_paid" : {
    "LABEL" : "Complete non-shippable order after payment received",
    "PLUGIN" : "reaction rule",
    "REQUIRES" : [ "rules", "uc_order" ],
    "ON" : [ "uc_order_status_update" ],
    "IF" : [
      { "data_is" : {
          "data" : [ "updated_order:order-status" ],
          "value" : "payment_received"
        }
      },
      { "NOT uc_order_condition_is_shippable" : { "order" : [ "updated_order" ] } }
    ],
    "DO" : [
      { "uc_order_update_status" : { "order" : [ "order" ], "order_status" : "completed" } }
    ]
  }
}
ownage’s picture

FileSize
59.74 KB

// Forewarning, I am just making sure my behavior for the Abandoned status is normal

----------

My client just got concerned that there were missing orders. That was not the case. It turns out, the "View by status" filter defaults to "Active" on /admin/store/orders/view, making it appear orders are missing. Abandoned order statuses are not listed on default because it is not considered an "Active" order status. That's fine!

Without finding any documentation on this "Abandoned" order status (and just going off of what I've seen), the major reason this happens is that the customer got to the Checkout or Review screen, backed out. This causes the status to change from "In Checkout" to "Abandoned" after a certain period of time (maybe somewhere between 30 minutes to an hour?)

Screenshot:
Abandoned Orders

However, that situation above is not the only scenario this will happen. One other scenario above showed that the order status was Pending, (however that person - like the others - had not paid). It, too, was listed as Abandoned. The only difference, is this order had a Order Status history of "Pending" -- All other orders had blank order statuses.

My questions:
1) What other scenarios exist to have an order status become abandoned?
2) Why doesn't the Order Status history document Abandoned? (Just like why it doesn't document In Checkout?)

It would be great to have some clarification on this.

ninebark’s picture

I'm having this issue as well, and it's effecting 1/3 of the orders placed on my website. They are marked Abandoned even though they have a transaction ID from PayPal.

Can I manually increase the abandonment timeout period, which was suggested as a possible cause above? Are there any other theories as to why this is happening, and how to solve it?

This seems like a serious issue to me, as it creates the potential for orders to become lost.

rberquist’s picture

I'm also intermittently having this issue.

Admin Comments:
12/18/2012 - 14:45 - Order created through website.
12/18/2012 - 14:45 - PayPal IPN reported a payment of 40.00 USD.

Order Comment:
12/18/2012 - 14:44 - Pending [censored]
12/18/2012 - 14:45 - Payment received Payment of 40.00 USD submitted through PayPal.

Order Log:
12/18/2012 - 14:43 - Order status changed from In checkout to Abandoned.
12/18/2012 - 14:45 - PayPal payment for $40.00 entered.

The users can sometimes be... older. It can take a while to input order details. Any way to lengthen the "abandon" time out?

UK_Rogue’s picture

Priority: Normal » Major

Same problem here but with Worldpay. The customer goes through checkout, gets redirected to hosted payment - Pays - But then there appears to be an issue with Ubercart receiving the callback to confirm payment was accepted. The order is classed as abandoned and unpaid. My client only knows an order was received as an email is sent by Worldpay. This is intermittent as 75% of the Customers orders go through correctly. Very Worrying for my client!

longwave’s picture

The culprit here, I believe, is uc_cart_cron() changing orders to "abandoned" while waiting for payment to be received. I think the solution is to add a new constant alongside UC_CART_ORDER_TIMEOUT which only abandons "in checkout" orders after, say, 48 hours.

UK_Rogue’s picture

Are their any temporary fixes we could implement now?

longwave’s picture

Comment out this line in uc_cart_cron() in uc_cart.module, which will stop orders being moved to "Abandoned":

    uc_order_update_status($order_id, 'abandoned');
Rafal Lukawiecki’s picture

I can confirm that I am also affected by this issue, however rarely. An occasional order is marked as having received IPN (it shows in the order log) but it is still marked as Abandoned.

GBurg’s picture

Yesterday there was a problem with paypal ipn making the payment reporting back to the website 12 hours after inital payment. All orders are off course put on abandoned by that time. I would love to see a solution that when an order is abandoned, but a payment is received, it will go on processing it.

For the people who want a quick and dirty solution:

Go to ubercart/uc_cart/uc_cart.module and edit line 18 from

/**
 * Time in seconds after which a cart order is deemed abandoned.
 */
php define('UC_CART_ORDER_TIMEOUT', 600); 

to

/**
 * Time in seconds after which a cart order is deemed abandoned.
 */
define('UC_CART_ORDER_TIMEOUT', 86400); // 24 hours 

it increases the time when an order is deemeed abandoned.

DanZ’s picture

Yeah, that one bit me, and right as I had finished bringing a site live.

A different solution is to set up the Rule for full payment to move Abandoned orders into Payment Received status. Here's the exported Rule:

{ "uc_payment_received" : {
    "LABEL" : "Update order status on full payment",
    "PLUGIN" : "reaction rule",
    "REQUIRES" : [ "uc_payment", "uc_order", "rules" ],
    "ON" : [ "uc_payment_entered" ],
    "IF" : [
      { "uc_payment_condition_order_balance" : { "order" : [ "order" ], "balance_comparison" : "less_equal" } },
      { "OR" : [
          { "uc_order_condition_order_state" : { "order" : [ "order" ], "order_state" : "in_checkout" } },
          { "uc_order_condition_order_state" : { "order" : [ "order" ], "order_state" : "post_checkout" } },
          { "data_is" : { "data" : [ "order:order-status" ], "value" : "abandoned" } }
        ]
      }
    ],
    "DO" : [
      { "uc_order_update_status" : { "order" : [ "order" ], "order_status" : "payment_received" } }
    ]
  }
}
laraz’s picture

#12 solves the problem apparently. thanks. I will tested in the next days.

GBurg’s picture

It is important to note that the proposed change of the Rule, won't affect other problems that arise from the UC_CART_ORDER_TIMEOUT, like: http://drupal.org/node/1969664 It is necessary to make a variable, that can be set by the system, instead of a constant.

benitezv1ang’s picture

I'm Using ubercart 7.x-3.4
Any progress with this issue. Besides the solutions above. Any update

longwave’s picture

Version: 7.x-3.1 » 7.x-3.x-dev
Status: Active » Needs review
FileSize
1.33 KB

The attached patch increases the abandonment timeout to 24 hours, except while the user is still in checkout where it is still 10 minutes. Can someone affected by this issue please test this and report back?

longwave’s picture

Status: Needs review » Fixed

Committed #16.

GBurg’s picture

There are different schemes on how you want to use your checkout page. I customized mine so people can fill in their profile information too. Therefor, I would be very unhappy if they already get a time out, after only 10 minutes. Maybe a setting is better?

Best regards,

Geert

longwave’s picture

Please open a separate issue to discuss changing the checkout timeout; I think it's a valid request but otherwise not directly related to this issue (the timeout was always fixed at 10 minutes).

Status: Fixed » Closed (fixed)

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

solarDog’s picture

I am having the same issue (as jeggen) except with Authorize.net (SIM). Customer follows through with transaction, clicks "Review Order" and gets redirected to authorize.net credit card form where they finish the transaction.

But, Ubercart lists the status as abandoned even though the transaction is completed and payment is received.
Is anyone else having this issue??

Andrey Kozhuhov’s picture

Have the same issue on 3.5.
Some orders (no matter Paypal or Authorize.net) becomes Abandoned after Payment Received status.
Looks like that https://www.dropbox.com/s/u9kkzb18o96lq6b/Screenshot%202015-12-10%2008.2...

stuart1882’s picture

Has this fix been implemented into the latest release 3.7.9?

Cayenne’s picture

Okay, it looks like I may have experienced an odd variant of this.
A customer paid by paypal, all well and good, till a couple of weeks later. His COMPLETED order got marked abandoned.

Here's the log. Any ideas? It's possible that we were not running the latest release, but even so, the sequence of changes is disturbing.

TIME USER CHANGES
2016-01-12 10:25 -
Order status changed from In checkout to Abandoned.
2015-12-22 15:11 -
Order status changed from Payment received to Completed.
2015-12-22 15:11 -
Order status changed from Pending to Payment received.
2015-12-22 15:11 -
Order status changed from In checkout to Pending.
2015-12-22 15:11 -
PayPal payment for $175.00 entered.

antongorodezkiy’s picture

@Cayenne did you solve the issue?
I just got the same one but for credit cards with Authorize.NET and the "Order status changed from In checkout to Abandoned" happened in ~25 hrs (Ubercart 3.13.0)

https://www.drupal.org/project/uc_authorizenet_simdpm/issues/2693413 is not my case because I don't use that module and the full payment was made.

The order log looks like this:

01/15/2021 - 02:00	-	Order status changed from In Checkout to Abandoned.
01/14/2021 - 01:01	-	Order status changed from Pending to Payment Received.
01/14/2021 - 01:01	-	Order status changed from In Checkout to Pending.
01/14/2021 - 01:01	-	Credit card payment for $345.00 entered.
antongorodezkiy’s picture

So I spent some time (and some hair from my head) but could reproduce the issue on my side.
It appears only when customer opens checkout in Tab1, fills in the fields, then clicks review or triggers ajax validation (on shipping option change for example) to save fields somehow.
After that customer opens the checkout in the second tab. Fills in cc number and cvv2. Clicks review and then finishes the checkout in the Tab2.
Finally customer opens Tab1 and triggers ajax validation once more.
Voila, the order status is `in_checkout` now. You can then change the status manually in admin and trigger ajax validation as customer again - status will become `in_checkout` once more.

Inside

function uc_cart_checkout_form($form, &$form_state, $order) {
// the $order->order_status is "in_checkout"

---

I fixed it (I think so) with the following method:

function rubberb_app_uc_cart_checkout_form_validate(&$form, &$form_state)
{
  $order = $form_state['storage']['order'];
  $freshOrder = uc_order_load($order->order_id);

  if ($freshOrder->order_status != $order->order_status) {
    $form_state['storage']['order']->order_status = $freshOrder->order_status;
  }
}
retiredpro’s picture

I've also been noticing a few orders going to "abandoned" status after being set to "payment received". Fortunately these have been rare occurrences so far.

I can replicate antongorodezkiy's checkout steps and confirm that the order goes back to "in checkout" which then later switches over to "abandoned" on cron.

Attached is a patch based off of antongorodezkiy's code.

It addresses the status change issue but users can still manipulate the order information such as delivery, billing, and shipping whenever ajax is called. I'll create a new issue and reference back to this one.

Rafal Lukawiecki’s picture

May I suggest that since you attached a patch, the status of this issue is changed to "Needs Review" so as not to suggest that the patch in #27 has been RTBC? While the patch looks benign, it should require some testing considering many of us run code that changes order statuses, and makes other changes to order data as part of more complex order workflows. I hope there are no issues with just reloading the order in this hook, but I would prefer to test.

In any case, many thanks for the patch @retiredpro.

retiredpro’s picture

Hi Rafal,

I agree that the patch should be set to "Needs Review" but I'm unable to reopen the issue. Only the project maintainer can reopen from a "Closed" status.

retiredpro’s picture

Hi Rafal,

I created a a new issue and patch. https://www.drupal.org/project/ubercart/issues/3196363

The new patch should prevent any order changes to the delivery, billing address, shipping options, etc. It also prevents the order status change which leads to abandoned from this issue. Any testing and feedback is appreciated. Thank you.

cmseasy’s picture

See also: https://www.drupal.org/project/ubercart/issues/3196363#comment-14487776

Patch #27 solved a similar issue in a one product setup.

Please reopen this ussue