Closed (fixed)
Project:
Commerce Core
Version:
8.x-2.x-dev
Component:
Order
Priority:
Normal
Category:
Feature request
Assigned:
Reporter:
Created:
4 Sep 2017 at 10:38 UTC
Updated:
1 Oct 2017 at 10:39 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
edaa commentedComment #3
edaa commentedPR https://github.com/drupalcommerce/commerce/pull/785 created.
Any thoughts on this case?
Comment #4
edaa commentedComment #5
megachrizWhat if payment fails? Can you still choose an other payment method in that case?
Comment #6
edaa commentedYou are right, I can't. Need to find another way to freeze the order.
Comment #7
edaa commentedMaybe just invoke finalizeCart on payment step, the order is still 'draft' and 'order refresh' will run on it.
Comment #8
edaa commentedComment #9
bojanz commentedWe planned this, but never implemented it.
We need a "locked" boolean on the order, and we need lock() / unlock() / isLocked() methods on OrderInterface.
We need CartProvider to filter out locked orders after they're loaded.
We need PaymentProcess to lock the order before rendering the offsite-form, and we need to make sure placing an order unlocks it.
We also need to figure out the admin UX for locked orders. My current idea is to return access denied, causing the edit tab to not be available, and have an unlock form for breaking the lock.
Comment #10
bojanz commentedWrapping this up.
Comment #11
bojanz commentedCurrent progress. There's a single test fail, OrderUserTest, which I haven't tracked down yet.
Comment #13
bojanz commentedFixed the bug that was failing the test, and made sure that clicking "Go back" in the checkout payment page (iframe gateways) unlocks the order.
Still feels like we need more test coverage, but what we added here is a good start.
Comment #14
edaa commentedWow, thanks, it works pretty well.