generated from ecomplus/application-starter
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathecom.config.js
154 lines (137 loc) · 4.16 KB
/
ecom.config.js
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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
/* eslint-disable comma-dangle, no-multi-spaces, key-spacing */
/**
* Edit base E-Com Plus Application object here.
* Ref.: https://developers.e-com.plus/docs/api/#/store/applications/
*/
const app = {
app_id: 125183,
title: 'Opiniões Verificadas',
slug: 'opinioes-verificadas',
type: 'external',
state: 'active',
authentication: true,
/**
* Uncomment modules above to work with E-Com Plus Mods API on Storefront.
* Ref.: https://developers.e-com.plus/modules-api/
*/
modules: {
/**
* Triggered to calculate shipping options, must return values and deadlines.
* Start editing `routes/ecom/modules/calculate-shipping.js`
*/
// calculate_shipping: { enabled: true },
/**
* Triggered to validate and apply discount value, must return discount and conditions.
* Start editing `routes/ecom/modules/apply-discount.js`
*/
// apply_discount: { enabled: true },
/**
* Triggered when listing payments, must return available payment methods.
* Start editing `routes/ecom/modules/list-payments.js`
*/
// list_payments: { enabled: true },
/**
* Triggered when order is being closed, must create payment transaction and return info.
* Start editing `routes/ecom/modules/create-transaction.js`
*/
// create_transaction: { enabled: true },
},
/**
* Uncomment only the resources/methods your app may need to consume through Store API.
*/
auth_scope: {
'stores/me': [
'GET' // Read store info
],
procedures: [
'POST' // Create procedures to receive webhooks
],
products: [
'GET', // Read products with public and private fields
// 'POST', // Create products
// 'PATCH', // Edit products
// 'PUT', // Overwrite products
// 'DELETE', // Delete products
],
orders: [
'GET', // List/read orders with public and private fields
// 'POST', // Create orders
// 'PATCH', // Edit orders
// 'PUT', // Overwrite orders
// 'DELETE', // Delete orders
]
/**
* You can also set any other valid resource/subresource combination.
* Ref.: https://developers.e-com.plus/docs/api/#/store/
*/
},
admin_settings: {
id_website: {
schema: {
type: 'string',
maxLength: 255,
title: 'ID Website',
description: 'Site de login. pode ser encontrado aqui https://www.opinioes-verificadas.com.br/index.php?page=mod_param_contact'
},
hide: true
},
secret_key: {
schema: {
type: 'string',
maxLength: 255,
title: 'Chave Secreta',
description: 'Chave secreta para identificação no envio dos pedidos para a plataforma. pode ser encontrado aqui https://www.opinioes-verificadas.com.br/index.php?page=mod_param_contact'
},
hide: true
},
account_country: {
schema: {
type: 'string',
enum: ['FR','ES','DE','IT','NL','UK','US','BR','PT','CO','PL','MX'],
title: 'País da Conta',
description: 'Escolha a opções correta ou o envio dos pedidos pode não funcionar corretamente.',
},
hide: true
},
send_order_paid: {
schema: {
type: 'boolean',
default: false,
title: 'Enviar pedido para Opiniões Verificadas após aprovação do pedido',
description: 'Ao ativar, o pedido será enviado assim que aprovado e não mais ao mudar status para entregue',
},
hide: true
}
}
}
/**
* List of Procedures to be created on each store after app installation.
* Ref.: https://developers.e-com.plus/docs/api/#/store/procedures/
*/
const procedures = []
const { baseUri } = require('./__env')
procedures.push({
title: app.title,
triggers: [
{
resource: 'orders',
field: 'fulfillment_status',
},
{
resource: 'orders',
field: 'financial_status',
}
],
webhooks: [
{
api: {
external_api: {
uri: `${baseUri}/ecom/webhook`
}
},
method: 'POST'
}
]
})
exports.app = app
exports.procedures = procedures