I built a digital media delivery system integrated with a 3rd party shopping cart.
After customers complete their credit card transaction on the PCI compliant shopping cart, they are redirected to a download page on our servers that gets created dynamically with PHP code. The links contain heavily encrypted code to digital product(s) hosted on outside servers that are NOT publicly accessible. In other words, to download the files you must have the secret sauce or it won't work. Any attempts to share links with other people will fail because the downloads must originate from our servers.
As a fallback, customers also get an auto generated email with the download links. They have 3 days to complete their downloads after which the links are auto disabled.
This system contains many server-side & client side scripts. If you are a skilled coder, it's doable. If not, you may need to outsource this to a 3rd party. Start with your shopping cart as they may already have solutions available for you to use.
Good luck!
Nancy