MultiSafepay / Magento2Msp

MultiSafepay plugin for Magento 2 (Deprecated) see: https://github.com/MultiSafepay/magento2
Open Software License 3.0
29 stars 25 forks source link

Stock inventory mixed up after second payment attempt #118

Closed dragonfly4 closed 4 years ago

dragonfly4 commented 4 years ago

Magento 2.3.4 MultiSafePay 1.10.0 PHP 7.3.16

Salable quantity is higher than actual stock if customer completes payment in 2 attempts.

Steps to reproduce

reservation_id stock_id sku quantity metadata
461 1 GYBATH-400 -1.0000 {"event_type":"order_placed","object_type":"order","object_id":"46687"}
reservation_id stock_id sku quantity metadata
464 1 GYBATH-400 1.0000 {"event_type":"order_canceled","object_type":"order","object_id":"46687"}

No changes in table inventory_reservation

reservation_id stock_id sku quantity metadata
719 1 GYBATH-400 1.0000 {"event_type":"shipment_created","object_type":"order","object_id":"46687"}

Order comment log

Notes for this Order User redirected to MultiSafepay Payment link: https://payv2.multisafepay.com/connect/removedaaaWqWWOqOUguxmXW/?lang=nl_BE Comment added Mar 29, 2020 12:58:43 PM

Transaction declined Comment added Mar 29, 2020 1:01:09 PM

MultiSafepay status: completed Notificatie ontvangen: Betaling vastgelegd voor 61,50 €. Transactie-ID: "343412464" Comment added Mar 29, 2020 1:02:37 PM

Order has been reopened because a new transaction was started by the customer! Comment added Mar 29, 2020 1:02:37 PM

MSP Settings

MSP_settings

Jasper-MultiSafepay commented 4 years ago

@dragonfly4 Thank you for reporting this. Do you happen to use Multi Source Inventory? We will try to reproduce this with the steps provided and investigate this further. Will keep you updated. PLGMAGTWOS-613

dragonfly4 commented 4 years ago

@Jasper-MultiSafepay Thanks! Let me know if you need more info. We use one Inventory. We do have 3 Store Views (nl - fr - en) referring to same orderid count as requested in #YED-254-52369. Ticket of 13/02/2020.

Jasper-MultiSafepay commented 4 years ago

@dragonfly4 A quick update, we can reproduce this at our side. It is being caused by having to reopen orders, when a consumer tries again on a payment link. Magento 2.3 calculates inventory/quantity/stock in a different way, which leads to our way of reopening orders isn't compatible now. We are working on a solution, while staying compatible with Magento 2.2. Will keep you updated.

Jasper-MultiSafepay commented 4 years ago

@dragonfly4 We now have a branch available which contains the cherry-picked changes. In case you already would like to use this on a staging environment, you can checkout the changes. https://github.com/MultiSafepay/Magento2Msp/compare/master...fix/stock-issues-reopen-orders

Or get the patch from https://github.com/MultiSafepay/Magento2Msp/compare/master...fix/stock-issues-reopen-orders.patch

Or use composer composer require multisafepay/magento2msp:dev-fix/stock-issues-reopen-orders

Next week we will have a release available, which will include this fix.

duckchip commented 4 years ago

@Jasper-MultiSafepay Any idea when this release will be available? thx!

Jasper-MultiSafepay commented 4 years ago

@duckchip There was some internal feedback, but I'm expecting a release including this fix at the end of this week

dragonfly4 commented 4 years ago

My high level testing on DEV looked good so fingers crossed.

vinodsowdagar commented 4 years ago

@dragonfly4 @duckchip

The fix for this issue is now available in our latest release: https://github.com/MultiSafepay/Magento2Msp/releases/tag/1.12.0

For now i am closing this issue. Please contact us again if you have any more feedback or questions regarding this matter.