3
3
// load the lib object
4
4
const {
5
5
welcome,
6
- newOrder ,
6
+ pending ,
7
7
abandonedCart,
8
8
delivered,
9
- payment ,
9
+ authorized ,
10
10
shipped,
11
- denied,
12
- canceled
11
+ unauthorized,
12
+ voided,
13
+ underAnalysis,
14
+ partiallyPaid,
15
+ paid,
16
+ inDispute,
17
+ partiallyRefunded,
18
+ refunded,
19
+ invoice_issued,
20
+ inProduction,
21
+ inSeparation,
22
+ readyForShipping,
23
+ partiallyShipped,
24
+ partiallyDelivered,
25
+ returnedForExchange,
26
+ receivedForExchange,
27
+ returned
13
28
} = require ( './../src/' )
14
29
15
30
// sample JSON data
@@ -41,9 +56,9 @@ browserSync.init({
41
56
}
42
57
} ,
43
58
{
44
- route : '/new-order ' ,
59
+ route : '/pending ' ,
45
60
handle ( req , res , next ) {
46
- newOrder ( store , customer , order , 'pt_br' )
61
+ pending ( store , customer , order , 'pt_br' )
47
62
. then ( html => res . end ( html ) )
48
63
. catch ( err => console . error ( err ) )
49
64
}
@@ -57,9 +72,9 @@ browserSync.init({
57
72
}
58
73
} ,
59
74
{
60
- route : '/payment ' ,
75
+ route : '/authorized ' ,
61
76
handle ( req , res , next ) {
62
- payment ( store , customer , order , 'pt_br' )
77
+ authorized ( store , customer , order , 'pt_br' )
63
78
. then ( html => res . end ( html ) )
64
79
. catch ( err => console . error ( err ) )
65
80
}
@@ -73,21 +88,141 @@ browserSync.init({
73
88
}
74
89
} ,
75
90
{
76
- route : '/denied ' ,
91
+ route : '/unauthorized ' ,
77
92
handle ( req , res , next ) {
78
- denied ( store , customer , order , 'pt_br' )
93
+ unauthorized ( store , customer , order , 'pt_br' )
79
94
. then ( html => res . end ( html ) )
80
95
. catch ( err => console . error ( err ) )
81
96
}
82
97
} ,
83
98
{
84
- route : '/canceled ' ,
99
+ route : '/voided ' ,
85
100
handle ( req , res , next ) {
86
- canceled ( store , customer , order , 'pt_br' )
101
+ voided ( store , customer , order , 'pt_br' )
87
102
. then ( html => res . end ( html ) )
88
103
. catch ( err => console . error ( err ) )
89
104
}
90
- }
105
+ } ,
106
+ {
107
+ route : '/under_analysis' ,
108
+ handle ( req , res , next ) {
109
+ underAnalysis ( store , customer , order , 'pt_br' )
110
+ . then ( html => res . end ( html ) )
111
+ . catch ( err => console . error ( err ) )
112
+ }
113
+ } ,
114
+ {
115
+ route : '/partially_paid' ,
116
+ handle ( req , res , next ) {
117
+ partiallyPaid ( store , customer , order , 'pt_br' )
118
+ . then ( html => res . end ( html ) )
119
+ . catch ( err => console . error ( err ) )
120
+ }
121
+ } ,
122
+ {
123
+ route : '/paid' ,
124
+ handle ( req , res , next ) {
125
+ paid ( store , customer , order , 'pt_br' )
126
+ . then ( html => res . end ( html ) )
127
+ . catch ( err => console . error ( err ) )
128
+ }
129
+ } ,
130
+ {
131
+ route : '/in_dispute' ,
132
+ handle ( req , res , next ) {
133
+ inDispute ( store , customer , order , 'pt_br' )
134
+ . then ( html => res . end ( html ) )
135
+ . catch ( err => console . error ( err ) )
136
+ }
137
+ } ,
138
+ {
139
+ route : '/partially_refunded' ,
140
+ handle ( req , res , next ) {
141
+ partiallyRefunded ( store , customer , order , 'pt_br' )
142
+ . then ( html => res . end ( html ) )
143
+ . catch ( err => console . error ( err ) )
144
+ }
145
+ } ,
146
+ {
147
+ route : '/refunded' ,
148
+ handle ( req , res , next ) {
149
+ refunded ( store , customer , order , 'pt_br' )
150
+ . then ( html => res . end ( html ) )
151
+ . catch ( err => console . error ( err ) )
152
+ }
153
+ } ,
154
+ {
155
+ route : '/invoice_issued' ,
156
+ handle ( req , res , next ) {
157
+ invoice_issued ( store , customer , order , 'pt_br' )
158
+ . then ( html => res . end ( html ) )
159
+ . catch ( err => console . error ( err ) )
160
+ }
161
+ } ,
162
+ {
163
+ route : '/in_production' ,
164
+ handle ( req , res , next ) {
165
+ inProduction ( store , customer , order , 'pt_br' )
166
+ . then ( html => res . end ( html ) )
167
+ . catch ( err => console . error ( err ) )
168
+ }
169
+ } ,
170
+ {
171
+ route : '/in_separation' ,
172
+ handle ( req , res , next ) {
173
+ inSeparation ( store , customer , order , 'pt_br' )
174
+ . then ( html => res . end ( html ) )
175
+ . catch ( err => console . error ( err ) )
176
+ }
177
+ } ,
178
+ {
179
+ route : '/ready_for_shipping' ,
180
+ handle ( req , res , next ) {
181
+ readyForShipping ( store , customer , order , 'pt_br' )
182
+ . then ( html => res . end ( html ) )
183
+ . catch ( err => console . error ( err ) )
184
+ }
185
+ } ,
186
+ {
187
+ route : '/partially_shipped' ,
188
+ handle ( req , res , next ) {
189
+ partiallyShipped ( store , customer , order , 'pt_br' )
190
+ . then ( html => res . end ( html ) )
191
+ . catch ( err => console . error ( err ) )
192
+ }
193
+ } ,
194
+ {
195
+ route : '/partially_delivered' ,
196
+ handle ( req , res , next ) {
197
+ partiallyDelivered ( store , customer , order , 'pt_br' )
198
+ . then ( html => res . end ( html ) )
199
+ . catch ( err => console . error ( err ) )
200
+ }
201
+ } ,
202
+ {
203
+ route : '/returned_for_exchange' ,
204
+ handle ( req , res , next ) {
205
+ returnedForExchange ( store , customer , order , 'pt_br' )
206
+ . then ( html => res . end ( html ) )
207
+ . catch ( err => console . error ( err ) )
208
+ }
209
+ } ,
210
+ {
211
+ route : '/received_for_exchange' ,
212
+ handle ( req , res , next ) {
213
+ receivedForExchange ( store , customer , order , 'pt_br' )
214
+ . then ( html => res . end ( html ) )
215
+ . catch ( err => console . error ( err ) )
216
+ }
217
+ } ,
218
+ {
219
+ route : '/returned' ,
220
+ handle ( req , res , next ) {
221
+ returned ( store , customer , order , 'pt_br' )
222
+ . then ( html => res . end ( html ) )
223
+ . catch ( err => console . error ( err ) )
224
+ }
225
+ } ,
91
226
] ,
92
227
93
228
// watch template source files and reload local server
0 commit comments