woothemes/woocommerce — pull request #3928 by thenbrent (2013-10-15 20:53:04+00:00)
Title: Add WC_Order::needs_payment() function & filter

There is currently no way for an extension to require payment via the "Pay" shortcode if an order has a $0 total (which makes perfect sense, until you have a pesky Subscriptions extension which uses an order with a $0 total for free trials).

This adds a new `WC_Order::needs_payment()` function as well as a `'woocommerce_order_needs_payment'` filter.

I looked at updating all instance of the `'woocommerce_valid_order_statuses_for_payment'` filter being used, but currently the `WC_Order::needs_payment()` function is a little different to that as it checks both for a valid status and the order total. So decided to leave them be for now.