paynl / magento2-plugin

The Pay. plugin for Magento 2
https://www.pay.nl
27 stars 31 forks source link

Coupon Usage not decrementing after cancelling order #176

Closed janssensjelle closed 1 year ago

janssensjelle commented 1 year ago

Extension version: 3.4.2 Magento: 2.4.5-p2

It seems that when placing an order with a shopping cart rule coupon with limited usage, after cancelling, the usage is not decremented.

Steps to reproduce

  1. Create a shopping cart rule with limited usage for customer (example: 1 use per customer)
  2. Use the discount code in the checkout
  3. Cancel the order / do not finish payment
  4. Two scenarios: a) When cancelling the order in the payment process, you will be redirected to the cart and you can't use the coupon again| b) When not finishing, Pay will send the cancel request after some time, but you can't use it afterwards

If the merchant manually cancels the order from the backend, the decrement is done successfully.

Possible fix Use the function cancelOrder in Magento\Sales\Model\Service\OrderService . This calls for the decrement function.

escruickshank commented 1 year ago

Hi @janssensjelle, thank you for your input, again! ;) We will look into this!

escruickshank commented 1 year ago

Hi @janssensjelle, we have fixed this issue in our latest release (3.5.0). Thank you for your input! I will now close this issue.