7
7
8
8
const app = {
9
9
app_id : 123113 ,
10
- title : 'My Awesome E-Com Plus App ' ,
11
- slug : 'my-awesome-app ' ,
10
+ title : 'Webhooks ' ,
11
+ slug : 'webhooks ' ,
12
12
type : 'external' ,
13
13
state : 'active' ,
14
14
authentication : true ,
@@ -75,21 +75,21 @@ const app = {
75
75
// 'DELETE', // Delete categories
76
76
] ,
77
77
customers : [
78
- // 'GET', // List/read customers
78
+ 'GET' , // List/read customers
79
79
// 'POST', // Create customers
80
80
// 'PATCH', // Edit customers
81
81
// 'PUT', // Overwrite customers
82
82
// 'DELETE', // Delete customers
83
83
] ,
84
84
orders : [
85
- // 'GET', // List/read orders with public and private fields
85
+ 'GET' , // List/read orders with public and private fields
86
86
// 'POST', // Create orders
87
87
// 'PATCH', // Edit orders
88
88
// 'PUT', // Overwrite orders
89
89
// 'DELETE', // Delete orders
90
90
] ,
91
91
carts : [
92
- // 'GET', // List all carts (no auth needed to read specific cart only)
92
+ 'GET' , // List all carts (no auth needed to read specific cart only)
93
93
// 'POST', // Create carts
94
94
// 'PATCH', // Edit carts
95
95
// 'PUT', // Overwrite carts
@@ -138,37 +138,33 @@ const app = {
138
138
} ,
139
139
140
140
admin_settings : {
141
- /**
142
- * JSON schema based fields to be configured by merchant and saved to app `data` / `hidden_data`, such as:
143
-
144
141
webhook_uri : {
145
142
schema : {
146
143
type : 'string' ,
147
144
maxLength : 255 ,
148
145
format : 'uri' ,
149
- title: 'Notifications URI',
150
- description: 'Unique notifications URI available on your Custom App dashboard'
146
+ title : 'Webhook URI' ,
147
+ description : 'URL de destino para os webhooks' ,
151
148
} ,
152
149
hide : true
153
150
} ,
154
- token : {
151
+ webhook_token : {
155
152
schema : {
156
153
type : 'string' ,
157
154
maxLength : 50 ,
158
- title: 'App token'
155
+ title : 'Token' ,
156
+ description : 'Bearer token opcional para o cabeçalho Authorization' ,
159
157
} ,
160
158
hide : true
161
159
} ,
162
- opt_in : {
160
+ skip_pending : {
163
161
schema : {
164
162
type : 'boolean' ,
165
163
default : false ,
166
- title: 'Some config option'
164
+ title : 'Ignorar pedidos pendentes' ,
167
165
} ,
168
- hide: false
166
+ hide : true
169
167
} ,
170
-
171
- */
172
168
}
173
169
}
174
170
@@ -181,18 +177,20 @@ const procedures = []
181
177
182
178
/**
183
179
* Uncomment and edit code above to configure `triggers` and receive respective `webhooks`:
180
+ */
184
181
185
182
const { baseUri } = require ( './__env' )
186
183
187
184
procedures . push ( {
188
185
title : app . title ,
189
186
190
187
triggers : [
191
- // Receive notifications when new order is created:
188
+ /* Receive notifications when new order is created:
192
189
{
193
190
resource: 'orders',
194
191
action: 'create',
195
192
},
193
+ */
196
194
197
195
// Receive notifications when order financial/fulfillment status are set or changed:
198
196
// Obs.: you probably SHOULD NOT enable the orders triggers below and the one above (create) together.
@@ -205,7 +203,7 @@ procedures.push({
205
203
field : 'fulfillment_status' ,
206
204
} ,
207
205
208
- // Receive notifications when products/variations stock quantity changes:
206
+ /* Receive notifications when products/variations stock quantity changes:
209
207
{
210
208
resource: 'products',
211
209
field: 'quantity',
@@ -229,6 +227,7 @@ procedures.push({
229
227
},
230
228
231
229
// Feel free to create custom combinations with any Store API resource, subresource, action and field.
230
+ */
232
231
] ,
233
232
234
233
webhooks : [
@@ -243,9 +242,6 @@ procedures.push({
243
242
]
244
243
} )
245
244
246
- * You may also edit `routes/ecom/webhook.js` to treat notifications properly.
247
- */
248
-
249
245
exports . app = app
250
246
251
247
exports . procedures = procedures
0 commit comments