web development, software and tutorials.

Digital Goods EasyPay Documentation

dg_easyPay – digital goods for paypal

Digital Goods easyPay is meant to be a plug and use solution
to that pesky payPal API interface – using digital goods in-context.

The main advantage for using an in-context solution is that
the payPal payment flow all happens within the window of
your website… providing a seemless experience for the user.

download dg_easyPay for only $20!


In order to use paypal’s digital goods interface you will need:

  1. a payPal BUSINESS account (personal and premier not accepted)
  2. your payment solution to be: PayPal for Digital Goods (Express Checkout) log in to paypal to do this.
    you set up your payment solution when you login to payPal:
    my account > profile > my selling tools > my business setup > set up my payment solutions
  3. API Credentials from payPal
    you define your API Credentials after you log into your payPal account at paypal by going to:
    my account > profile > my selling tools > selling online > API access
  4. provide a digital good! - a downloadable file etc.
    no shipping options are allowed with digital goods.
  5. have your sever in a country that allows the digital goods payment flow.

Likewise for testing purposes using payPal’s sandbox,
you will need to setup a seller and a buyer in your sandbox environment.
From there you can get the test sellers API credentials.


The download file is a .zip file. Simply extract the downloaded zip file into the directory where you would like
to use dg_easyPay!

If you are running wordpress… download Digital Goods easyPay for wordpress here.

download dg_easyPay for only $20
pay using payPal – this payment flow infact uses dg_easyPay!

download dg_easyPay for only $20!


In the extracted zip file you will notice an index.html file.

- In the head section of the index file you will notice 4 dependancies

  • 1 css style file
          – dg.css
  • 3 js files
          – jquery-1.5.1.min.js
          – https://www.paypalobjects.com/js/external/dg.js
          – dg_easyPay_init.js

these are important files and must remain with the installation as dg_cancel.php, dg_download.php and dg_paySuccess.php all include these files into their headers as well.

- in the body of the index file you will notice:

  • buyDiv
  • msgBox
          – this is a div which is used to show messages from the javascript
  • anchor <a> tags within the buyDiv with class=’d_goods’
          The script will not run with out the class declaration d_goods’ on the anchor tag
          The image tag is loaded from paypal and is also necessary for the script to run (paypal requirement)

          So, please be aware of the structure:


    <a  href="dg_easyPay.php?dgFile=filename2.pdf" class='d_goods' >
    <img src="https://www.paypal.com/en_US/i/btn/btn_dg_pay_w_paypal.gif" border="0" /></a>



          you have a digital file you sell — say an ebook called: my_ebook.pdf

          the html would then look like:


    <a  href="dg_easyPay.php?dgFile=my_ebook.pdf" class='d_goods' >
    <img src="https://www.paypal.com/en_US/i/btn/btn_dg_pay_w_paypal.gif" border="0" /></a>
  • IN GENERAL THERE ARE ONLY THREE STEPS TO FOLLOW: (provided you have a business account with payPal)

    • STEP 1. name your file(s) in the anchor tag(s) (as outlined above)
      <a  href="dg_easyPay.php?dgFile=your_filename.xxx" class='d_goods' >
      <img src="https://www.paypal.com/en_US/i/btn/btn_dg_pay_w_paypal.gif" border="0" /></a>
    • STEP 2. upload your files to the dgMedia folder. (make sure they are ‘readable’ so they can be downloaded!)
    • STEP 3. open dg_config and fill out the following:
      • a. DIGITAL_GOODS – enter into an array information regarding your digital goods files
        the format is:

              "name"=>"A fancier name for the filename1",
              "description"=>"a description of the file"
              "name"=>"Another fancy name for filename2",
              "description"=>"a description of the file"
      • b. SITE definition:
        your FULL URL to where dg_easyPay.php is located
        - if your dg_easyPay.php file is located at: http://www.yoursite.com/yourfolder/dg_easyPay.php
        then your FULL URL to that location is: http://www.yoursite.com/yourfolder/
      • c. PAYPAL_API_SITE definition:
        which paypal API site will you use? enter either the sandbox for testing
        or the live site for live



      • d. PAYPAL_SITE definition
        which paypal site will you use?
        sandbox or live site



      • e. API CREDENTIALS definition
        this is important…. you will not get a reponse from paypal without it!
        you define your API Credentials after you log into your payPal account at paypal by going to:
        my account > profile > my selling tools > selling online > API access
        if you are using the sandbox… make sure you have created a seller… use the sellers
        API credentials listed in the sandbox for the following definitions

        the definitions looks something like:

        define("API_USERNAME", "seller_131344534859_biz_api1.yourtestsite.com");
        define("API_PASSWORD", "1313454895");
        define("API_SIGNATURE", "AiPC9BjkCyDFQXbSkoZcgqH3hpacAfzcY5W6ggSRI3w2gRHGYJJhT2rx");

Post a Comment

You must be logged in to post a comment.