Physical transfer doesn't really matter. Either you've incurred a debt (in which case they're legally required to take cash) or you haven't (in which case you're free to walk out of the store, leaving the ice cream to melt).
The store would need to require that you pay before the scooping began to avoid this, IMO.
Right, but if you've taken possession, you've definitely incurred a debt. If they've scooped the ice cream but haven't handed it to you, while there may technically be a debt at that point, I expect most stores would just throw the ice cream out if you insisted on paying with a payment method they don't accept.
If you can order the ice cream and take possession of it before paying, you've incurred a debt. At that point, the store must be willing to accept cash (or forgive the debt altogether). End result: you've got ice cream.
If you order the ice cream but don't take possession of it until you pay, the store is free to reject your cash payment and not give you the ice cream. End result: no ice cream. If this occurs frequently enough, the waste from the store having to prepare and throw out ice cream might prompt them to change their policy, but that's not an immediate solution.
The store would need to require that you pay before the scooping began to avoid this, IMO.