Before we delve into any code or even content, let's consider how we want the process to look from the buyer perspective.
Buyer browses products and adds some to his/her online shopping cart
Buyer initiates checkout process and is prompted to pay for the product
Upon successful payment, buyer is presented with relevant download links on the confirmation page and in the confirmation e-mail.
This is rather straightforward from the buyer's perspective. Let's now consider what we will need to do to achieve this.
Associate the actual downloads with products: We will do this by adding a related object attribute to one of our product classes.
Shopping cart and checkout process: This is a built-in eZ Publish feature and we will use most of the defaults here.
Payment process: We will install an existing PayPal payment gateway extension, making use of the eZ Publish workflow system.
Download permissions: We will write an extension to assign permissions at checkout so that the buyer can access the files associated with the purchased products.
Confirmation page and e-mail: We will modify existing eZ Publish templates to add the necessary download information.