<p>This is likely due to the item going out of stock while they were away from the cart, then when they went to pay, the item had to be removed from the cart, but they should have seen an error message when they tried to pay:</p>

<blockquote>
  <p>Something changed with the order before payment, please review your order and submit payment again.</p>
</blockquote>

<p>The secondary issue is allowing zero value orders. At the moment, zero value orders are allowed and payment gateways are not even called due to the payment due being zero.</p>

<p>On the client side, you could hide the payment buttons if the order value is zero.</p>

<p>We should introduce an <code>allowPaymentOnZeroValueCarts</code> type config option that stops these orders from coming through if dezired. I will add that to the next release.</p>

<p>I might also be a good idea to put some javascript on the page, that forces a refresh after a timeout.</p>

CC BY-SA 3.0
2017-02-15T12:15:38.427Z
Thanks Luke. The allowPaymentOnZeroValueCarts sounds helpful. It sounds like the customer was already on the payment page when they disappeared for an hour, so I wouldn't be able to hide the payment buttons without the Javascript refresh, which I'll look at.

None of the products have stock, though, as they're set to unlimited. Is there another explanation?
Clive Portman
CC BY-SA 3.0
2017-02-15T10:52:40.540Z
2017-02-15T10:52:40.540Z
Luke Holder
<p>We had a Stripe order go through recently, where the order value was zero and there were no line items. The client has called the customer to figure out what happened:</p>

<ol>
<li>The customer added a product to the cart as normal.</li>
<li>They entered their address details.</li>
<li>They reached the payment page and left it there for over an hour.</li>
<li>They returned and went to pay with Stripe, entering their card details and the payment seemingly going through but with a value of £0.00.</li>
<li>They were redirected to the order thank you page and received their order email detailing their purchase of nothing for £0.00.</li>
<li>They then completed the purchase afresh and it went through fine.</li>
</ol>

<p>It's presumably an issue with the cart timing out. Does anyone know if there is anything I can do about this?</p>

CC BY-SA 3.0
2018-02-14T21:14:52.207Z
I've just had the exact scenario on a client's site. The product had stock and the customer only paused on the payment page for about 4 minutes. It appears that the customer's cart and lineitems were cleared and when she submitted the payment a new cart was created with no items in it. The cart's create and update date/time are identical suggesting it was created and never updated. That's why I think it was created right before/after the payment processing.
Anna_MediaGirl
<plugin-craftcommerce><cookies><timeout><omnipay-stripe>
Craft Commerce cart timing out but allowing order to be processed
# Craft Commerce cart timing out but allowing order to be processed

(Asked by: username_0 on 2017-02-15)

We had a Stripe order go through recently, where the order value was zero and there were no line items. The client has called the customer to figure out what happened:

1. The customer added a product to the cart as normal.
2. They entered their address details.
3. They reached the payment page and left it there for over an hour.
4. They returned and went to pay with Stripe, entering their card details and the payment seemingly going through but with a value of £0.00.
5. They were redirected to the order thank you page and received their order email detailing their purchase of nothing for £0.00.
6. They then completed the purchase afresh and it went through fine.

It's presumably an issue with the cart timing out. Does anyone know if there is anything I can do about this?

**Tags:** plugin-craftcommerce, cookies, timeout, omnipay-stripe
> **Comments:**
> **username_1**: I've just had the exact scenario on a client's site. The product had stock and the customer only paused on the payment page for about 4 minutes. It appears that the customer's cart and lineitems were cleared and when she submitted the payment a new cart was created with no items in it. The cart's create and update date/time are identical suggesting it was created and never updated. That's why I think it was created right before/after the payment processing.  

---

## 1 answers

### Answer by username_2 on 2017-02-15. Score: 1

This is likely due to the item going out of stock while they were away from the cart, then when they went to pay, the item had to be removed from the cart, but they should have seen an error message when they tried to pay:

> Something changed with the order before payment, please review your order and submit payment again.

The secondary issue is allowing zero value orders. At the moment, zero value orders are allowed and payment gateways are not even called due to the payment due being zero.

On the client side, you could hide the payment buttons if the order value is zero.

We should introduce an `allowPaymentOnZeroValueCarts` type config option that stops these orders from coming through if dezired. I will add that to the next release.

I might also be a good idea to put some javascript on the page, that forces a refresh after a timeout.

> **Comments:**
> **username_0**: Thanks Luke. The allowPaymentOnZeroValueCarts sounds helpful. It sounds like the customer was already on the payment page when they disappeared for an hour, so I wouldn't be able to hide the payment buttons without the Javascript refresh, which I'll look at.  None of the products have stock, though, as they're set to unlimited. Is there another explanation?  

---

