-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathModuleConfig.cfc
53 lines (44 loc) · 1.2 KB
/
ModuleConfig.cfc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
/**
* This module wraps the Utrust API: https://utrust.com/
**/
component {
// Module Properties
this.modelNamespace = 'utrustCFML';
this.cfmapping = 'utrustCFML';
this.parseParentSettings = true;
/**
* Configure
*/
function configure(){
// Skip information vars if the box.json file has been removed
if( fileExists( modulePath & '/box.json' ) ){
// Read in our box.json file for so we don't duplicate the information above
var moduleInfo = deserializeJSON( fileRead( modulePath & '/box.json' ) );
this.title = moduleInfo.name;
this.author = moduleInfo.author;
this.webURL = moduleInfo.repository.URL;
this.description = moduleInfo.shortDescription;
this.version = moduleInfo.version;
}
// Settings
settings = {
'apiKey' : ''
, 'webhookSecret' : ''
, 'environment' : 'sandbox'
};
}
function onLoad(){
binder.map( "stores@utrustCFML" )
.to( "#moduleMapping#.models.stores" )
.asSingleton()
.initWith(
apiKey = settings.apiKey
, environment = settings.environment
);
binder.map( "webhook@utrustCFML" )
.to( "#moduleMapping#.models.webhook" )
.initWith(
webhookSecret = settings.webhookSecret
);
}
}