-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathModuleConfig.cfc
67 lines (62 loc) · 2.44 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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
component {
this.name = "cbox-commerce";
this.author = "Jon Clausen <[email protected]>";
this.webUrl = "https://github.com/jclausen/cbox-commerce";
this.dependencies = [ "quick", "cfmigrations", "cffractal", "cbstorages", "BCrypt", "cbsecurity" ];
this.cfmapping = "cbc";
this.modelNamespace = "cbc";
this.entryPoint = "cbox-commerce";
function configure() {
settings = {
"products" : {
// Allows for the configuration of an external products model, to interface with existing databases
"externalModel" : false,
"externalModelBinding" : "",
"externalModelMapping" : {},
"defaultCurrency" : "USD"
},
"media" : {
//local or s3 storage currently supported
"driver" : getEnv( 'CBC_MEDIA_DRIVER', 'local' ),
// for local drivers, this would be the path from the root of the site
"storageLocation" : "/includes/shared/cbc",
// Only used for s3 driver
"s3" : {
"key" : getEnv('AWS_ACCESS_KEY_ID', ''),
"secret" : getEnv('AWS_SECRET_ACCESS_KEY', ''),
"region" : getEnv('AWS_DEFAULT_REGION', ''),
"bucket" : getEnv('AWS_BUCKET', ''),
// the AWS base URL for serving assets ( e.g. cloudflare )
"url" : getEnv('AWS_URL', ''),
},
//the security service - may be changed to use a different wirebox mapping ( e.g. - ContentBox )
"securityService" : "SecurityService@cbc"
},
"payments" : {
"processor" : {
"default" : "StripeProcessor@cbc",
"credentials" : {
//credentials will vary, depending on the implmented processor
}
}
}
};
// Custom Declared Interceptors
interceptors = [
{
class="cbc.interceptors.CBCQuickEntity",
name="CBCQuickEntityInterceptor"
}
];
}
function onLoad() {
//change our binder mapping
if( settings.products.externalModel ){
binder
.map(
alias = "ExternalProduct@cbc",
force = true
).to( settings.products.externalModelMapping );
}
}
}