Why would !order-summary token be available/unavailable depending on payment method? I'm trying to use a payment gateway module (Icepay for Drupal Commerce), but I noticed that the payment method I choose in checkout influences the availability of order tokens.

I have Commerce Message configured with an email using the !order-summary token (like Commerce Kickstart does). When I choose commerce_payment_example's payment on checkout, the email contains the expected line items and total price provided by !order-summary. When I choose Icepay, this part remains empty in the email.

Could the payment method influence the availability of tokens? Is there something the payment module needs to implement for that, or should I be looking at other causes?
Of course I find the issue after posting the bounty :s

This Commerce Message issue explains that the problem is that some payment methods need to do a postback, which is executed as anonymous user. This apparently means that the view which returns the order summary (commerce_cart_summary) is also executed as anonymous and returns no results, so the token remains empty. The commerce_payment_example method does not have this problem because it doesn't rely on any external feedback.

The workaround to disable SQL rewriting in the commerce_cart_summary view works (I haven't tested the patch yet).