I have created an e-book store for client to sell his PDF file with WordPress and WooCommerce plugin. You will get many tutorials online about how to setup WooCommerce. So here I am writing about the downloads parts of PDF file.
Once you have WooCommerce plugin activated, you will want to change some of the settings to enable WooCommerce for downloads.
STEP 1 : Login to admin area > WooCommerce > Settings > Set the selling locations to Sell to all countries, Then, set your currency to what you want to be selling in.
STEP 2 : Login to admin area > WooCommerce > Products > Set the File Download Method to “Force Downloads”
STEP 3 : As per client requirements, I installed Stripe Payment Gateway
STEP 4 : In Stripe Payment Gateway page, I updated the public key and secret key. Also added the url (http://example.com/?wc-api=wc_stripe) as a web hook in Stripe account settings
STEP 5 : Login to admin area > Products > Add Products and then add title, a description of the product and a category for the product. In product data > Select Simple Product > Select downlodable. Then upload your files by clicking on the add file button and uploading your eBook file. I just marked the required fields in the below screenshot
STEP 6 : Go through the product page and placing an order using the below details
Card number : 4242424242424242
MM/YY : 20/20
CVC : 123
STEP 7 : Login to admin area > WooCommerce > Orders > select the checkbox in order id > Mark as Completed > Click Apply
Then you will get an email notification in order placed email id, with a pdf download link.
I have created a video tutorial to help you understand better: