I’m using Commerce combined with Stripe and Card on File. I’m trying to set up a workflow where when a user makes a purchase, we run a small authorisation charge (to check the card is valid and store details in CoF) and then refund that charge immediately. We then return later (up to 60 days) and charge the full amount.
The setup I have at the moment is Rules based. When the user checks out, Stripe runs an authorisation-only transaction for the order total, the relevant tokens stored in the db, and an immediate refund fired. Then, when other criteria are fulfilled, we run the full authorisation-and-capture transaction using those tokens, and update the order status to “Complete”.
This works fine, with one potential issue. The sums involved can be quite large, and the refund process (even just for authorisation) can take 3-5 days. Which means the customer could have quite a chunk of change blocked out (if not charged) on their account for several days, when they’re not expecting to pay until some time in the future.
So my question is this: how can I introduce a small charge (like $ 1.00) which is attached to the order, authorised and refunded, while still mantaining the integrity of the existing order and checkout process (which works great)?
My first thought was to alter the line item price to $ 1.00, make the auth charge, then reset to the Product price before making the full charge. However, I’ve hit a brick wall in that I can’t see how to update an order (specifically Order Total field) after that first checkout; no combination of entity loading / saving / updating seems to stick. FWIW the user is restricted to only one item per transaction; there can only ever be one line item at a time in the cart or in an order.
I’m sure my case is a bit niche – but has anyone had success in implementing delayed payments like this in DC? Any ideas for an alternative approach gratefully received.