Permalink
Browse files

new method of including submodules

  • Loading branch information...
1 parent 1ce4b80 commit 7777b670b308546a88748c7ea29e12c1cf658c4b @jamescarr committed Aug 15, 2010
Showing with 16 additions and 14 deletions.
  1. +7 −4 lib/authorizenet/client.js
  2. +1 −1 lib/payflowpro/paypal-network-client.js
  3. +4 −8 lib/paynode.js
  4. +4 −1 package.json
View
@@ -1,7 +1,8 @@
+require.paths.unshift(__dirname)
var EventEmitter = require('events').EventEmitter,
GatewayClient = require('../gateway-client').GatewayClient,
- response = require('authorizenet/response-parser')
+ response = require('response-parser')
exports.createClient = function(options, netClient){
var conn = netClient || new GatewayClient({
@@ -13,13 +14,15 @@ exports.createClient = function(options, netClient){
return new Client(options, conn)
}
+exports.levels = require('levels').levels
+
function Client(options, netClient){
var addOptionAttributes = function(req){
req.x_login= options.login
req.x_tran_key=options.tran_key
- req.x_version= "3.1"
- req.x_delim_data= "TRUE"
- req.x_delim_char= "|"
+ req.x_version= "3.1"
+ req.x_delim_data= "TRUE"
+ req.x_delim_char= "|"
req.x_relay_response= "FALSE"
return req
}
@@ -1,5 +1,5 @@
-var GatewayClient = require('gateway-client').GatewayClient,
+var GatewayClient = require('../gateway-client').GatewayClient,
paypalResponse = require('response-parser')
function PaypalNetworkClient(host, authInfo){
View
@@ -1,10 +1,6 @@
require.paths.unshift(__dirname);
-[{name:'payflowProGateway', location:'payflowpro/client'}
- ,{name:'authorizeNetGateway', location:'authorizenet/client'}
-].forEach(function(module){
- exports.__defineGetter__(module.name, function(){
- return require(module.location)
- })
-})
-
+exports.use = function(name){
+ return require(__dirname + '/'+name+'/client')
+}
+
View
@@ -1,7 +1,10 @@
{ "name" : "paynode"
,"main" : "./lib/paynode"
+ ,"directories" :{
+ "lib":"./lib"
+ }
,"description" : "Payment Gateway Adapters for Node.js"
- ,"version" : "0.0.2"
+ ,"version" : "0.0.3"
,"author" : "James R. Carr <james.r.carr@gmail.com>"
,"repository" :
{"type" : "git"

0 comments on commit 7777b67

Please sign in to comment.