QuickPay / magento-v2

Open Software License 3.0
5 stars 20 forks source link

Blindly attempting to capture a payment on shipment create? #22

Closed WebKenth closed 3 years ago

WebKenth commented 3 years ago

On this line: https://github.com/QuickPay/magento-v2/blob/master/Observer/CaptureOrderShipmentAfter.php#L35

You attempt to capture a payment and then throw an exception when it might not work as you think.

It should be possible for an order in Magento to be shipped without payment being triggered

In my case i create an invoice before i create a shipment. This causes an exception for the Quickpay Module...

If the payment has already been captured, it can no longer be shipped. welp the entire order is now stuck in an invalid state

Thanks D:

Please check on the $payment->canCapture() before you attempt to capture it

WebKenth commented 3 years ago

Additionally it seems you blindly capture the transaction without updating the order payment at all

This leads to a dead invoice now which can only be captured offline -.-'

CodemakersDK commented 3 years ago

It has now been fixed as of v 2.1.3. There is now an admin setting "Capture automatically after shipment creation", that controls whether or not a payment should be captured on shipment create (which was a requirement of quite a few users)