duncanmcclean / simple-commerce

A simple, yet powerful e-commerce addon for Statamic.
https://statamic.com/addons/duncanmcclean/simple-commerce
Other
146 stars 40 forks source link

Order is created every time there is an intent but no payment #578

Closed lokmanm closed 2 years ago

lokmanm commented 2 years ago

Bug Description

Hi Duncan,

I was not sure if this is a bug or feature but If you add a product to the cart go to checkout and remove the product it will show up as a new order with intent.

This can easily pollute the orders collection every time someone is trying to add a product and then remove it.

Steps to reproduce

  1. Add a product to cart
  2. Go to checkout
  3. Remove product
  4. Check orders collection

Environment

Statamic 3.2.32 Pro
Laravel 7.30.6
PHP 8.0.14
aryehraber/statamic-captcha 1.7.0
doublethreedigital/sc-digital-products 2.2.3
doublethreedigital/simple-commerce 2.3.64
doublethreedigital/yumyum 1.1.0
statamic/seo-pro 2.3.2
duncanmcclean commented 2 years ago

Correct, that's the intended behaviour. If you don't want to keep unpaid orders, you can delete them with a schuduled task (or something similar).

Simple Commerce should be automatically filtering the orders in the CP to paid orders only so you don't see a bunch of junk orders.

image