Secure Digital Download Add-on
Help on setting up and using the secure digital download program (SDD) add-on. SDD uses DropBox to manage its secure downloads.
Contents
- FAQ
- Customer Usage (step 3)
- Order a digital download product
- Errors that could occur
- Create a Digital Download Product (step 2)
- Product setup in slscart
- Adding products
- Using a folder in Dropbox
- Customizing the return page
- Install (step 1)
- Information needed
- slscart setup
- Mals setup
- Create a return page
- Defaults and examples
- Troubleshooting
FAQ
Q: I also had a question about with the digital downloads, so in mals-e,
or elsewhere in the digital software, do those have to have the prices
updated when they are changed (the prices updated in the software settings
too?) in order for it to match it back to the product for download?
A: No.
Once a person makes a sdd purchase, the link they are sent is to dropbox.
The link does not contain any pricing information.
Q: What type of picture can I use to represent the
digital download?
A: Any picture you want. It is independent of the
download.
Q: If I change the prices on the website, will the person still get
their download?
A: Yes. They will get the download for the price they paid.
Q: The downloadable file won't download when the link is
clicked on.
A: There are many reasons why:
- Determine if it is
just one download or all downloads.
- The Dropbox Path entered in
does not match the filename in dropbox file list.
- The filename
in the dropbox file list has a leading blank in front of the name.
- The file does not exist in Dropbox.
Customer Usage
It is assumed that install and product setup steps have been completed. This section describes how a customer orders and receives a digital download product from slscart.
Ordering
After the digital download order is complete, the customer will be taken to the return page (the one specified in $DownloadTemplate). The link can be clicked to download the product. An email is also sent to the user where they can click on a link to download the ordered product. The download link expires in the time specified in column F of the product_list.
If the product is downloaded, a notification email is sent to the $NotifyDownloadEmail email.
Errors that could occur
There are errors that can occur during ordering, mostly due to incorrect setup. The error messages and the corresponding reasons are given:
- Access Denied
- Incorrect Mals hash key.
- Call Denied
- The buyer will see this if the path (in Column D in csv file) is incorrect or dropbox is not working.
- Caller Access Denied
- There is a syntax error in the csv file.
The wrong location entered for dropbox file (e.g. missing or incorrect directory).
The Mals secret key is incorrect. - Price of product is less than the minimum price level.
- The buyer will see this after purchase: Amount paid for products is not sufficient.
- The codes, like !!!product!!!, are not converted
- Not linked to linklokmeret.php in Mals: Cart setup > Customize >
Return link
Missing csv file.
Incorrect catalog# entered in csv file. - !!!product!!! is not converted
- Make sure the catalog number exists
Make sure the 'Show Catalog#' in Catalog Setup is set to 'Always Show' or 'Cart Only' - Order Failed
- Incorrect $SellerID.
Create a Digital Download Product
It is assumed that install step has been performed. This section describes how to set up a digital download product in slscart.
Product Setup
A product needs a catalog number to work with SDD. If you do not like the catalog number showing, displaying it can be turned off under Administration > Catalog Setup. In the Items section there is a setting called Show Catalog#:
Click here for more information on using the catalog number.
slscart 10.4.1 or later
SDD is much easier to use.
1. Open your Dropbox account in a browser.
2. Upload your downloadable file(s) to your dropbox.
3. Create your product in slscart store admin. The product must have a catalog id. It does not have to be all digits; it can have upper and lowercase alphabet in it, too (e.g. STE135).
4. In the Secure Digital Download section of the product:
- Enter in a short description. It is displayed in the email sent to the buyer and the return page. You must not use commas in the description. They will be stripped out.
- Enter in location and filename of download file in dropbox. See Notes for examples.
Here is what the short description and dropbox path entries look like for a product in store admin:
5. Save changes.
Error codes
These sdd-specific error codes can occur during updating a product.
- 1 = writing .csv file failed
- 2 = open or reset or creation of .csv file failed
- 3 = empty csvline. No products with .csv
- 4 = could not create random dir
- 5 = one or more products had empty catalog#
Notes
If the file (example: mydownload.jpg) is put in dropbox then
location/filename is mydownload.jpg
If the file is put in a dropbox
directory (example: posters) then the location/filename is
posters/mydownload.jpg
If the file is put in a subdirectory (example:
posters/current) then the use posters/current/mydownload.jpg
Keeping files in Dropbox folders
If there are a lot of downloadable files, it is easier to keep them in folders.
1. Open your Dropbox account in a browser.
2. Create a folder by clicking on 'New folder' and entering in a name for it (in this example, the new folder is 'misc' (no quotes).
3. Copy the download files into the 'misc' directory. (in this example the file is 'ccubsflag.jpg'.
4. Create your product in slscart store admin. The product must have a catalog id. It does not have to be all digits; it can have upper and lowercase alphabet in it, too (e.g. STE135).
5. In the Secure Digital Download section of the product:
- Enter in a short description. It is displayed in the email sent to the buyer and the return page. You must not use commas in the description. They will be stripped out.
- Enter in location and filename of download file in dropbox. See Notes for examples.
Here is what the short description and dropbox path using a folder look like for a product in store admin:
6. Save changes.
slscart 10.4.0 or lower
1. Open your dropbox account in a browser.
2. Upload your downloadable file(s) to your dropbox.
3. Create your product in slscart. The product must have a catalog id. It does not have to be all digits; it can have upper and lowercase alphabet in it, too (e.g. STE135).
4. Open a new spreadsheet. If you don't have Excel or LibreOffice, see Notes below.
If you have Microsoft Excel spreadsheet or LibreOffice calc open a new worksheet. We'll call it product_list
If you do not have a spreadsheet, open a new file in a simple text editor like NotePad (do not use Microsoft Word). See Notes.
5. Add the products to the spreadsheet. One product per row.
- Column A: product's catalog id
- Column B: short product description. It is displayed in the email sent to the buyer and the return page. You must not use commas in the description.
- Column C: minimum price. C0=300 (that is C zero) or you can set it C0=0
- Column D: path to downloadable product in dropbox (see Notes below)
- Column E: 0 (that's zero. It is there for backwards compatibility)
- Column F: timeout, in minutes, before the product link expires. 1440 = 1 day. Use 0 (zero) for never expires.
6. Save the spreadsheet. Use the name product_list Note this must match what was specified in install $ProductCSV.
In Excel use Save As and save as type: CSV (MS DOS)
In LibreOffice, use Save As, select Text CSV
In NotePad, save as product_list.csv
The file saved should be named product_list.csv
7. Upload product_list.csv to the random directory created during install (X3CgJt2DNbgPgR in our example) on the server. Now there is a file called product_list.csv in directory X3CgJt2DNbgPgR Note this must match what was specified in $ProductCSV
Notes
Column C: The minimum price level for DDP. This is intended to reduce fraud. If the price of the product is below this level (i.e. someone changed it), DDP will not process the order. If you sell a product for $9.99, you can set the minimum level to 9.99 or 9 or whatever you choose. C0 is C Zero. You can add C1=, C2=, etc if there are options (explained later)
Column D: The path to the product in dropbox. For example, for a product
in dropbox called abc.jpg, the path would be: db|/abc.jpg
A
product, def.jpg, in a folder called rtu the path would be:
db|/rtu/def.jpg
db|/ is interpreted as the root of dropbox.
No spreadsheet? - A csv file can be created or edited with a simple text editor like NotePad. (NOT Microsoft Word).
Here is what the product_list.csv file looks like:
IH5DG,5 dollar gold piece,C0=300.00,db|/prod1.zip,0,700 EYEPOKE8, Moe Picture,C0=5.00,db|/stooges/moe.jpg,0,60 ELFF01,Enjoy Life Flag,C0=13.00,db|/prod2.zip,0,60
Adding products to an existing
1. Open your dropbox account in a browser.
2. Upload your downloadable file(s) to your dropbox.
3. Create your product in slscart. The product must have a catalog id. It does not have to be all digits; it can have upper and lowercase alphabet in it, too (e.g. STE135).
4. Open the existing spreadsheet. If you don't have Excel or LibreOffice, see Notes below.
If you have Microsoft Excel spreadsheet or LibreOffice calc open the existing worksheet product_list.csv
If you do not have a spreadsheet, open it in a simple text editor like NotePad (do not use Microsoft Word). See Notes.
5. Add/delete/change the products in the spreadsheet. One product per row.
- Column A: product's catalog id
- Column B: short product description. It is displayed in the email sent to the buyer and the return page. You must not use commas in the description.
- Column C: minimum price. C0=300 (that is C zero) or you can set it C0=0
- Column D: path to downloadable product in dropbox (see Notes below)
- Column E: 0 (that's zero. It is there for backwards compatibility)
- Column F: timeout, in minutes, before the product link expires. 1440 = 1 day. Use 0 (zero) for never expires.
6. Save the spreadsheet. Use the name product_list Note this must match what was specified in install $ProductCSV.
In Excel use Save As and save as type: CSV (MS DOS)
In LibreOffice, use Save As, select Text CSV
The file saved should be named product_list.csv
7. Upload product_list.csv to the random directory created during install (X3CgJt2DNbgPgR in our example) on the server. Now there is a file called product_list.csv in directory X3CgJt2DNbgPgR Note this must match what was specified in $ProductCSV
Customizing the Return Page
Customizing the return page is mentioned here. The return page was created during install.
Install SDD
In order to have a secure digital download for your store, the store will need to have a valid SSL certificate (not self-signed).
We highly recommend using dropbox to store digital download assets. 2 GB storage for the free version. Click here to go to dropbox
Mandatory Information needed
- Secret key from Mals
- Mals seller id
- dropbox account
- dropbox access token
- name of random directory
- Your company name
- Email address (for order inquiries)
Optional information needed
- Copy email - copy of order emails sent here
- Do you want to use HTML or plain text for emails?
- Email for notification of all downloads (i.e. every time someone clicked on a download link)
Install Digital Download
The sdd files to copied to home directory from are in the slc_addons/sdd directory.
- dropbox-sdk directory
- linklokme.php
- linklokmeret.php
- linklok_email_template.html (opt)
slscart setup
- copy linklokme.php and linklokmeret.php to slscart root dir
- copy dropbox-sdk folder to root dir (not necessary for linklokme 2.8 and beyond)
- create a random, hard to remember directory (like RQGeQyMv72HWOZ) in root directory. This is where the product list file is kept.
- Run add-on installer for secure digital download
- In store admin Administration > Catalog Setup
- enter the random directory under Dir:
- enter product list filename (use product_list.csv)
- Enter in link timeout, in minutes (1440 = 1 day)
- Save changes
- create order return page in 'pages'. This will be entered on $DownloadTemplate.
- [opt] set up SMTP
Mals setup
- get secret key from Mals (requires payment password)
- Login to Mals
- Click on Cart setup tab
- Under Advanced Settings, click on LINK VERIFICATION link
- Under Javascript button creator click on Hash secret on its own radio button
- Fill in your Mals payments password and click GET VALIDATOR button. The secret key will show up
- set mals remote http link: Cart setup > Advanced settings > remote
call
- The method used to call your script: HTTPS POST
- Link to linklokme.php
- Under Cart setup tab > Customize > Return link
- set mals return link: use https. Link to linklokmeret.php.
- Under REQUEST METHOD select:
Form button using the text above. POST request. - Click orange button UPDATE RECORD
- Mals payment processor
- PayPal only
- PayPal Payments Standard - (premium, free) use PayPal express checkout instead
- PayPal Express Checkout - (premium, free)
- PayPal Payments Advanced - (premium)
- PayPal Payments Pro - (premium)
- PayPal only
Dropbox setup
Upload product to dropbox
Set up as an app in dropbox developers
linklokme.php setup
This requires editing the linklokme.php file.
* path to product list
$ProductCSV = "X3CgJt2DNbgPgR/product_list.csv";
this must match the random directory created in slscart setup step 3
// Setup admin and security variables $LinklokURL = "https://www.mydomain.com/linklokme.php"; // URL of the linklokme.php page on your site $SellerID = "ABC12345"; // mals-e seller id (username) $SellerCompany = "My Company, Inc"; // Your company name $SellerEmail = "abc@mydomain.com"; // Your email address for order enquiries $SellerURL = "https://www.mydomain.com/"; // Your website URL $LinkKey = "lime122juice"; // Encryption key for download links. Any random word. $SecretKey="125e7323232339479c5e31b050c"; // Mals Secret key $CopyEmail = ""; // Receive copy of order emails. email address or "" $ManualPassword = ""; // Password for manual order entry. "" to disable $HTMLEmail = "Y"; // Set to Y to use HTML formatted emails or N to send in plain-text
$ErrorEmail = ''; // any error that occurs, an email is sent here.
$NotifyDownloadEmail = ""; // notify for every download
// Setup optional template pages
//$EmailTemplate =
"linklok_email_template.html";
$EmailTemplate = "";
$ErrorTemplate =
"";
$WarningTemplate = "";
$WarningTemplatePage= "";
//$DownloadTemplate = "";
$DownloadTemplate =
"https://www.example.com/pages/sdd_return.php";
// Optional security
settings
$IPlock=0; // To enable set to 1 to 4. To disable set to 0
(default).
$OrderList=""; // Points to a list of completed transactions
or extra security
$DelayCheck = "N"; // Set to Y to delay Check or (other
payment methods) listed below.
$DelayFreeEmail = "Y"; // Set to Y to
delay orders using free email services listed below
// OptionCart
settings
$SiteBuilder="Y";
$SiteBuilderUseId="Y";
$SiteBuilderUseOptions="N";
$RemoteCallPassThru =
"https://www.example.com/go/finish.php";
// use dropbox
$dropboxaccessToken="v70LVfxp2-AAAAAAAAAAGAiCG";
require_once "dropbox-sdk/Dropbox/autoload.php";
use \Dropbox as dbx;
$dbxClient = new dbx\Client($dropboxaccessToken, "DDP Downloads SLS");
slscart store admin setup
For slscart 10.4.1 or later
Under Administration > Catalog Setup > Secure Digital Download section, enter in the following:
Random Dir: Enter the random hard to remember directory created previously
Filename: Enter the csv filename. Default is product_list.csv
Link Expiration: Enter in the number of minutes before the download link expires. Default is 1440 (1 day). The countdown starts just after the download product's order is completed.
Create a return page
The return page is where the customer will end up after a digital download purchase.
In store admin, create a new page called ddp_return (you can call it something else).
Turn off 'show link'
In Content: fill in your message for customers after they complete an order. Change My Company to your company's name and mydomain to your store's domain.
Thank you for your order. For reference your order number is !!!orderno!!!. Please use the links below to download your purchase. !!!product!!! If you have any questions regarding this order please contact us. My Company https://www.example.com/ support@example.com
There are many special entries that can be used that are automatically filled in once a purchase is completed.
!!!orderno!!! will be
replaced by the Mals order number
!!!product!!! will
be replaced with product download link (from dropbox)
Customization notes on secure digital download add-on.
There are several more SDD variables that can be used.
ebbb
$LinklokURL - The path to the download file is added on to this. Make sure it is https:// It also shows up in email link.
The $SellerEmail is put into default download email as a mailto:
The $SellerEmail is put into default download email as a mailto:
The
$SellerEmail is used as the 'from' email address when sending out the
download email to the customer and notification email $NotifyDownloadEmail
The 'from' email addr should match the server or else SPF will be invalid
== extras
enable/disable phpmailer
== email template
template for email sent
Defaults and Examples
Default return page after a successful SDD order.
Note that this is all that shows. A return page should be set up because a page uses the site's template. The path to the return page needs to be set in $DownloadTemplate
Thank you for your order. For reference your order number is 4521986. Please use the links below to download your purchase. To download 5 dollar gold piece click the link below: prod1.zip (180 Bytes) ~ Download link will expire in 11 hours & 40 minutes If you have any questions regarding this order please contact us. My Company Software https://www.example.com/ support@example.com
Example Email
Here is an example email sent to a customer after a successful order
Thank you for your order. For reference your order number is 2837483. Please use the links below to download your purchase. To download Moe Picture click the link below: moe.jpg ~ Download link will expire in 1 hour If you have any questions regarding this order please contact us. My Company https://www.example.com/ support@example.com
Troubleshooting
***