Script that lets customers choose the price

Here’s a site that does something I want to re-create for my own site:

The basic description for this is that the user inputs how much they want to pay for an item and clicks the submit button. The download begins at that point and unless the user inputs “0” the user is redirected to PayPal with a transaction set up and the user completes the transaction through PayPal. Just wondering if anyone has worked on something like this before and could point me in the direction of how to set this up. Thanks!