node-payments
Version:
node-payments is a express based facade to multiple payment services.
52 lines (42 loc) • 952 B
text/coffeescript
_ = require( "lodash" )
module.exports = class MemoryStore extends require( "../basic" )
constructor: ->
super
"You are using the fallback in memory store!"
= {}
# just a simulation to globaly handle server powered stores
= false
return
connect: =>
"connect"
= true
return
get: ( id, cb )=>
process.nextTick =>
"GET. current id list", id, Object.keys( )
if [ id ]?
cb( null, [ id ] )
return
cb( null )
return
return
set: ( payment, cb )=>
process.nextTick =>
[ payment.id ] = payment.valueOf()
"saved", payment.id, payment.toString()
cb( null )
return
return
destroy: ( payment, cb )=>
process.nextTick =>
"destroy", payment.id
_.omit( , [ payment.id ] )
cb( null )
return
return
clear: ( cb )=>
"clear"
= {}
cb()
return