'use strict';

module.exports = function(accessKey, /*optional*/hostName) {
  //store the access key
  GLOBAL.accessKey = accessKey

  //const pjson = require('./package.json');
  GLOBAL.standard_options = {
      hostname: (typeof hostName === 'undefined')?'account.paydemic.com':hostName,
      port: 443,
      headers: {
          'Content-Type': 'application/x-www-form-urlencoded',
          'User-Agent': 'paydemic-node/' + require('./package.json').version
      }
    };

  //present all public methods
  return {
    PurchaseLinks: require('./lib/PurchaseLinks.js')
  }
}




@@ -47,30 +47,8 @@
 sKey
-, /*optional*/hostName
 ) %7B%0A
@@ -207,22 +207,48 @@
 eof 
-hostName
+process.env.PAYDEMIC_ACCOUNT_DOMAIN
  === 
-'
 unde
@@ -252,17 +252,16 @@
 ndefined
-'
 )?'accou
@@ -281,16 +281,43 @@
 om':
-hostName
+process.env.PAYDEMIC_ACCOUNT_DOMAIN
 ,%0A  

use environment variable PAYDEMIC_ACCOUNT_DOMAIN to switch to the test domain when needed