How do I let my customers download files they've purchased? --or-- Why aren't my customers' roles being updated?

Site setup

Make a new workflow configuration to update the order status to completed when checkout is complete and the order balance is 0 (or less). Set the file downloads or roles to be available on completed orders.

What's happening is the payment is received and the order gets updated before the user account is created for anonymous users. The file downloads or role permissions fail to be attached to a user because there isn't one yet.