@moksa/plugin-ecpay 0.0.0-stage → 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,1418 @@
1
+ {
2
+ "id": "moksa-ecpay",
3
+ "version": "0.1.0",
4
+ "declaredAccess": {
5
+ "network": {
6
+ "request": {
7
+ "allowedHosts": [
8
+ "payment-stage.ecpay.com.tw",
9
+ "payment.ecpay.com.tw",
10
+ "ecpayment-stage.ecpay.com.tw",
11
+ "ecpayment.ecpay.com.tw",
12
+ "logistics-stage.ecpay.com.tw",
13
+ "logistics.ecpay.com.tw",
14
+ "einvoice-stage.ecpay.com.tw",
15
+ "einvoice.ecpay.com.tw"
16
+ ]
17
+ }
18
+ }
19
+ },
20
+ "capabilities": [
21
+ "network:request"
22
+ ],
23
+ "allowedHosts": [
24
+ "payment-stage.ecpay.com.tw",
25
+ "payment.ecpay.com.tw",
26
+ "ecpayment-stage.ecpay.com.tw",
27
+ "ecpayment.ecpay.com.tw",
28
+ "logistics-stage.ecpay.com.tw",
29
+ "logistics.ecpay.com.tw",
30
+ "einvoice-stage.ecpay.com.tw",
31
+ "einvoice.ecpay.com.tw"
32
+ ],
33
+ "storage": {
34
+ "trades": {
35
+ "indexes": [
36
+ "orderNumber",
37
+ "status",
38
+ "createdAt",
39
+ [
40
+ "orderNumber",
41
+ "createdAt"
42
+ ]
43
+ ]
44
+ },
45
+ "events": {
46
+ "indexes": [
47
+ "createdAt"
48
+ ]
49
+ },
50
+ "orders": {
51
+ "indexes": [
52
+ "updatedAt",
53
+ "invoiceDueAt"
54
+ ]
55
+ },
56
+ "shipments": {
57
+ "indexes": [
58
+ "orderNumber",
59
+ "status",
60
+ "updatedAt",
61
+ [
62
+ "open",
63
+ "updatedAt"
64
+ ],
65
+ [
66
+ "orderNumber",
67
+ "updatedAt"
68
+ ]
69
+ ]
70
+ },
71
+ "invoices": {
72
+ "indexes": [
73
+ "status",
74
+ "updatedAt"
75
+ ]
76
+ },
77
+ "reports": {
78
+ "indexes": [
79
+ "status",
80
+ "nextAt",
81
+ [
82
+ "status",
83
+ "nextAt"
84
+ ]
85
+ ]
86
+ }
87
+ },
88
+ "hooks": [
89
+ "plugin:activate",
90
+ "cron"
91
+ ],
92
+ "routes": [
93
+ {
94
+ "name": "migrate/import",
95
+ "methods": [
96
+ "POST"
97
+ ],
98
+ "permission": "plugins:manage"
99
+ },
100
+ {
101
+ "name": "migrate/kv",
102
+ "methods": [
103
+ "POST"
104
+ ],
105
+ "permission": "plugins:manage"
106
+ },
107
+ {
108
+ "name": "migrate/stats",
109
+ "methods": [
110
+ "GET",
111
+ "POST"
112
+ ],
113
+ "permission": "plugins:manage"
114
+ },
115
+ {
116
+ "name": "bus/methods",
117
+ "methods": [
118
+ "POST"
119
+ ],
120
+ "request": {
121
+ "body": "text",
122
+ "maxBytes": 262144,
123
+ "headers": [
124
+ "x-moksa-bus-ts",
125
+ "x-moksa-bus-id",
126
+ "x-moksa-bus-sig"
127
+ ]
128
+ },
129
+ "public": true
130
+ },
131
+ {
132
+ "name": "bus/checkout",
133
+ "methods": [
134
+ "POST"
135
+ ],
136
+ "request": {
137
+ "body": "text",
138
+ "maxBytes": 262144,
139
+ "headers": [
140
+ "x-moksa-bus-ts",
141
+ "x-moksa-bus-id",
142
+ "x-moksa-bus-sig"
143
+ ]
144
+ },
145
+ "public": true
146
+ },
147
+ {
148
+ "name": "bus/notify",
149
+ "methods": [
150
+ "POST"
151
+ ],
152
+ "request": {
153
+ "body": "text",
154
+ "maxBytes": 262144,
155
+ "headers": [
156
+ "x-moksa-bus-ts",
157
+ "x-moksa-bus-id",
158
+ "x-moksa-bus-sig"
159
+ ]
160
+ },
161
+ "public": true
162
+ },
163
+ {
164
+ "name": "bus/gw/return",
165
+ "methods": [
166
+ "POST"
167
+ ],
168
+ "request": {
169
+ "body": "text",
170
+ "maxBytes": 262144,
171
+ "headers": [
172
+ "x-moksa-bus-ts",
173
+ "x-moksa-bus-id",
174
+ "x-moksa-bus-sig"
175
+ ]
176
+ },
177
+ "public": true
178
+ },
179
+ {
180
+ "name": "bus/events",
181
+ "methods": [
182
+ "POST"
183
+ ],
184
+ "request": {
185
+ "body": "text",
186
+ "maxBytes": 262144,
187
+ "headers": [
188
+ "x-moksa-bus-ts",
189
+ "x-moksa-bus-id",
190
+ "x-moksa-bus-sig"
191
+ ]
192
+ },
193
+ "public": true
194
+ },
195
+ {
196
+ "name": "bus/reports/due",
197
+ "methods": [
198
+ "POST"
199
+ ],
200
+ "request": {
201
+ "body": "text",
202
+ "maxBytes": 262144,
203
+ "headers": [
204
+ "x-moksa-bus-ts",
205
+ "x-moksa-bus-id",
206
+ "x-moksa-bus-sig"
207
+ ]
208
+ },
209
+ "public": true
210
+ },
211
+ {
212
+ "name": "bus/reports/ack",
213
+ "methods": [
214
+ "POST"
215
+ ],
216
+ "request": {
217
+ "body": "text",
218
+ "maxBytes": 262144,
219
+ "headers": [
220
+ "x-moksa-bus-ts",
221
+ "x-moksa-bus-id",
222
+ "x-moksa-bus-sig"
223
+ ]
224
+ },
225
+ "public": true
226
+ },
227
+ {
228
+ "name": "bus/shipping/methods",
229
+ "methods": [
230
+ "POST"
231
+ ],
232
+ "request": {
233
+ "body": "text",
234
+ "maxBytes": 262144,
235
+ "headers": [
236
+ "x-moksa-bus-ts",
237
+ "x-moksa-bus-id",
238
+ "x-moksa-bus-sig"
239
+ ]
240
+ },
241
+ "public": true
242
+ },
243
+ {
244
+ "name": "bus/invoice/options",
245
+ "methods": [
246
+ "POST"
247
+ ],
248
+ "request": {
249
+ "body": "text",
250
+ "maxBytes": 262144,
251
+ "headers": [
252
+ "x-moksa-bus-ts",
253
+ "x-moksa-bus-id",
254
+ "x-moksa-bus-sig"
255
+ ]
256
+ },
257
+ "public": true
258
+ },
259
+ {
260
+ "name": "bus/invoice/verify",
261
+ "methods": [
262
+ "POST"
263
+ ],
264
+ "request": {
265
+ "body": "text",
266
+ "maxBytes": 262144,
267
+ "headers": [
268
+ "x-moksa-bus-ts",
269
+ "x-moksa-bus-id",
270
+ "x-moksa-bus-sig"
271
+ ]
272
+ },
273
+ "public": true
274
+ },
275
+ {
276
+ "name": "bus/gw/logistics-map",
277
+ "methods": [
278
+ "POST"
279
+ ],
280
+ "request": {
281
+ "body": "text",
282
+ "maxBytes": 262144,
283
+ "headers": [
284
+ "x-moksa-bus-ts",
285
+ "x-moksa-bus-id",
286
+ "x-moksa-bus-sig"
287
+ ]
288
+ },
289
+ "public": true
290
+ },
291
+ {
292
+ "name": "bus/gw/logistics-map-reply",
293
+ "methods": [
294
+ "POST"
295
+ ],
296
+ "request": {
297
+ "body": "text",
298
+ "maxBytes": 262144,
299
+ "headers": [
300
+ "x-moksa-bus-ts",
301
+ "x-moksa-bus-id",
302
+ "x-moksa-bus-sig"
303
+ ]
304
+ },
305
+ "public": true
306
+ },
307
+ {
308
+ "name": "bus/gw/logistics-notify",
309
+ "methods": [
310
+ "POST"
311
+ ],
312
+ "request": {
313
+ "body": "text",
314
+ "maxBytes": 262144,
315
+ "headers": [
316
+ "x-moksa-bus-ts",
317
+ "x-moksa-bus-id",
318
+ "x-moksa-bus-sig"
319
+ ]
320
+ },
321
+ "public": true
322
+ },
323
+ {
324
+ "name": "bus/refund",
325
+ "methods": [
326
+ "POST"
327
+ ],
328
+ "request": {
329
+ "body": "text",
330
+ "maxBytes": 262144,
331
+ "headers": [
332
+ "x-moksa-bus-ts",
333
+ "x-moksa-bus-id",
334
+ "x-moksa-bus-sig"
335
+ ]
336
+ },
337
+ "public": true
338
+ },
339
+ {
340
+ "name": "trades/list",
341
+ "methods": [
342
+ "GET",
343
+ "POST"
344
+ ],
345
+ "permission": "plugins:manage"
346
+ },
347
+ {
348
+ "name": "trades/query",
349
+ "methods": [
350
+ "GET",
351
+ "POST"
352
+ ],
353
+ "permission": "plugins:manage"
354
+ },
355
+ {
356
+ "name": "trades/refund",
357
+ "methods": [
358
+ "POST"
359
+ ],
360
+ "permission": "plugins:manage"
361
+ },
362
+ {
363
+ "name": "trades/capture",
364
+ "methods": [
365
+ "POST"
366
+ ],
367
+ "permission": "plugins:manage"
368
+ },
369
+ {
370
+ "name": "trades/card-status",
371
+ "methods": [
372
+ "GET",
373
+ "POST"
374
+ ],
375
+ "permission": "plugins:manage"
376
+ },
377
+ {
378
+ "name": "shipments/create",
379
+ "methods": [
380
+ "POST"
381
+ ],
382
+ "permission": "plugins:manage"
383
+ },
384
+ {
385
+ "name": "shipments/list",
386
+ "methods": [
387
+ "GET",
388
+ "POST"
389
+ ],
390
+ "permission": "plugins:manage"
391
+ },
392
+ {
393
+ "name": "shipments/sync",
394
+ "methods": [
395
+ "GET",
396
+ "POST"
397
+ ],
398
+ "permission": "plugins:manage"
399
+ },
400
+ {
401
+ "name": "shipments/print",
402
+ "methods": [
403
+ "GET",
404
+ "POST"
405
+ ],
406
+ "permission": "plugins:manage"
407
+ },
408
+ {
409
+ "name": "shipments/sync-all",
410
+ "methods": [
411
+ "POST"
412
+ ],
413
+ "permission": "plugins:manage"
414
+ },
415
+ {
416
+ "name": "shipments/void",
417
+ "methods": [
418
+ "POST"
419
+ ],
420
+ "permission": "plugins:manage"
421
+ },
422
+ {
423
+ "name": "shipments/print-batch",
424
+ "methods": [
425
+ "GET",
426
+ "POST"
427
+ ],
428
+ "permission": "plugins:manage"
429
+ },
430
+ {
431
+ "name": "invoices/issue",
432
+ "methods": [
433
+ "POST"
434
+ ],
435
+ "permission": "plugins:manage"
436
+ },
437
+ {
438
+ "name": "invoices/get",
439
+ "methods": [
440
+ "GET",
441
+ "POST"
442
+ ],
443
+ "permission": "plugins:manage"
444
+ },
445
+ {
446
+ "name": "invoices/void",
447
+ "methods": [
448
+ "POST"
449
+ ],
450
+ "permission": "plugins:manage"
451
+ },
452
+ {
453
+ "name": "invoices/allowance",
454
+ "methods": [
455
+ "POST"
456
+ ],
457
+ "permission": "plugins:manage"
458
+ },
459
+ {
460
+ "name": "invoices/due",
461
+ "methods": [
462
+ "POST"
463
+ ],
464
+ "permission": "plugins:manage"
465
+ },
466
+ {
467
+ "name": "invoices/query",
468
+ "methods": [
469
+ "GET",
470
+ "POST"
471
+ ],
472
+ "permission": "plugins:manage"
473
+ },
474
+ {
475
+ "name": "admin",
476
+ "permission": "plugins:manage"
477
+ }
478
+ ],
479
+ "mcp": {
480
+ "tools": [
481
+ {
482
+ "name": "list_trades",
483
+ "description": "List ECPay trades (one per payment attempt), newest first, optionally for one order number. Status: created, awaiting (ATM/CVS code issued), paid, failed.",
484
+ "route": "trades/list",
485
+ "permission": "plugins:manage",
486
+ "destructive": false,
487
+ "inputSchema": {
488
+ "$schema": "http://json-schema.org/draft-07/schema#",
489
+ "type": "object",
490
+ "properties": {
491
+ "orderNumber": {
492
+ "type": "string",
493
+ "minLength": 1,
494
+ "maxLength": 18,
495
+ "pattern": "^[A-Z0-9]+$"
496
+ },
497
+ "limit": {
498
+ "type": "integer",
499
+ "minimum": 1,
500
+ "maximum": 100,
501
+ "default": 20
502
+ }
503
+ },
504
+ "additionalProperties": true
505
+ }
506
+ },
507
+ {
508
+ "name": "query_trade",
509
+ "description": "Ask ECPay for the current status of a trade by MerchantTradeNo (TradeStatus 1 = paid, 0 = not paid).",
510
+ "route": "trades/query",
511
+ "permission": "plugins:manage",
512
+ "destructive": false,
513
+ "inputSchema": {
514
+ "$schema": "http://json-schema.org/draft-07/schema#",
515
+ "type": "object",
516
+ "properties": {
517
+ "merchantTradeNo": {
518
+ "type": "string",
519
+ "minLength": 1,
520
+ "maxLength": 20,
521
+ "pattern": "^[A-Za-z0-9]+$"
522
+ }
523
+ },
524
+ "additionalProperties": true,
525
+ "required": [
526
+ "merchantTradeNo"
527
+ ]
528
+ }
529
+ },
530
+ {
531
+ "name": "card_status",
532
+ "description": "A paid ECPay card trade's authorization and capture status (Authorized, To be captured, Captured, Refunded, Cancelled) with the captured amount and history.",
533
+ "route": "trades/card-status",
534
+ "permission": "plugins:manage",
535
+ "destructive": false,
536
+ "inputSchema": {
537
+ "$schema": "http://json-schema.org/draft-07/schema#",
538
+ "type": "object",
539
+ "properties": {
540
+ "merchantTradeNo": {
541
+ "type": "string",
542
+ "minLength": 1,
543
+ "maxLength": 20,
544
+ "pattern": "^[A-Za-z0-9]+$"
545
+ }
546
+ },
547
+ "additionalProperties": true,
548
+ "required": [
549
+ "merchantTradeNo"
550
+ ]
551
+ }
552
+ },
553
+ {
554
+ "name": "capture_trade",
555
+ "description": "Capture (關帳) a paid ECPay card trade for its amount less refunds, when automatic capture is off.",
556
+ "route": "trades/capture",
557
+ "permission": "plugins:manage",
558
+ "destructive": true,
559
+ "inputSchema": {
560
+ "$schema": "http://json-schema.org/draft-07/schema#",
561
+ "type": "object",
562
+ "properties": {
563
+ "merchantTradeNo": {
564
+ "type": "string",
565
+ "minLength": 1,
566
+ "maxLength": 20,
567
+ "pattern": "^[A-Za-z0-9]+$"
568
+ }
569
+ },
570
+ "additionalProperties": true,
571
+ "required": [
572
+ "merchantTradeNo"
573
+ ]
574
+ }
575
+ },
576
+ {
577
+ "name": "list_shipments",
578
+ "description": "List 綠界物流 shipments, newest first, optionally for one order number (status, tracking number, provider fields).",
579
+ "route": "shipments/list",
580
+ "permission": "plugins:manage",
581
+ "destructive": false,
582
+ "inputSchema": {
583
+ "$schema": "http://json-schema.org/draft-07/schema#",
584
+ "type": "object",
585
+ "properties": {
586
+ "orderNumber": {
587
+ "type": "string",
588
+ "maxLength": 20
589
+ },
590
+ "limit": {
591
+ "type": "integer",
592
+ "minimum": 1,
593
+ "maximum": 100,
594
+ "default": 20
595
+ }
596
+ },
597
+ "additionalProperties": true
598
+ }
599
+ },
600
+ {
601
+ "name": "create_shipment",
602
+ "description": "Create the 綠界物流 shipment for a paid (or cash-on-delivery) order; an existing live shipment is returned instead.",
603
+ "route": "shipments/create",
604
+ "permission": "plugins:manage",
605
+ "destructive": true,
606
+ "inputSchema": {
607
+ "$schema": "http://json-schema.org/draft-07/schema#",
608
+ "type": "object",
609
+ "properties": {
610
+ "orderNumber": {
611
+ "type": "string",
612
+ "minLength": 1,
613
+ "maxLength": 20,
614
+ "pattern": "^[A-Z0-9]+$"
615
+ }
616
+ },
617
+ "additionalProperties": true,
618
+ "required": [
619
+ "orderNumber"
620
+ ]
621
+ }
622
+ },
623
+ {
624
+ "name": "sync_all_shipments",
625
+ "description": "Ask 綠界物流 for the status of every open shipment now (up to 100, oldest first) and apply the changes.",
626
+ "route": "shipments/sync-all",
627
+ "permission": "plugins:manage",
628
+ "destructive": false,
629
+ "inputSchema": {
630
+ "$schema": "http://json-schema.org/draft-07/schema#",
631
+ "type": "object",
632
+ "properties": {},
633
+ "additionalProperties": true
634
+ }
635
+ },
636
+ {
637
+ "name": "sync_shipment",
638
+ "description": "Ask 綠界物流 for a shipment's current status and apply it.",
639
+ "route": "shipments/sync",
640
+ "permission": "plugins:manage",
641
+ "destructive": false,
642
+ "inputSchema": {
643
+ "$schema": "http://json-schema.org/draft-07/schema#",
644
+ "type": "object",
645
+ "properties": {
646
+ "shipmentId": {
647
+ "type": "string",
648
+ "minLength": 1,
649
+ "maxLength": 64
650
+ }
651
+ },
652
+ "additionalProperties": true,
653
+ "required": [
654
+ "shipmentId"
655
+ ]
656
+ }
657
+ },
658
+ {
659
+ "name": "print_shipment_label",
660
+ "description": "The 綠界物流 shipping label: a signed form (action + params) to open in a browser, a URL, or label HTML.",
661
+ "route": "shipments/print",
662
+ "permission": "plugins:manage",
663
+ "destructive": false,
664
+ "inputSchema": {
665
+ "$schema": "http://json-schema.org/draft-07/schema#",
666
+ "type": "object",
667
+ "properties": {
668
+ "shipmentId": {
669
+ "type": "string",
670
+ "minLength": 1,
671
+ "maxLength": 64
672
+ }
673
+ },
674
+ "additionalProperties": true,
675
+ "required": [
676
+ "shipmentId"
677
+ ]
678
+ }
679
+ },
680
+ {
681
+ "name": "void_shipment",
682
+ "description": "Void a 綠界物流 shipment that has not shipped yet (cancel at the carrier's back office when it has no cancel API).",
683
+ "route": "shipments/void",
684
+ "permission": "plugins:manage",
685
+ "destructive": true,
686
+ "inputSchema": {
687
+ "$schema": "http://json-schema.org/draft-07/schema#",
688
+ "type": "object",
689
+ "properties": {
690
+ "shipmentId": {
691
+ "type": "string",
692
+ "minLength": 1,
693
+ "maxLength": 64
694
+ }
695
+ },
696
+ "additionalProperties": true,
697
+ "required": [
698
+ "shipmentId"
699
+ ]
700
+ }
701
+ },
702
+ {
703
+ "name": "issue_invoice",
704
+ "description": "Issue the 綠界電子發票 invoice for a paid order (idempotent: an issued invoice is returned).",
705
+ "route": "invoices/issue",
706
+ "permission": "plugins:manage",
707
+ "destructive": false,
708
+ "inputSchema": {
709
+ "$schema": "http://json-schema.org/draft-07/schema#",
710
+ "type": "object",
711
+ "properties": {
712
+ "orderNumber": {
713
+ "type": "string",
714
+ "minLength": 1,
715
+ "maxLength": 20,
716
+ "pattern": "^[A-Z0-9]+$"
717
+ }
718
+ },
719
+ "additionalProperties": true,
720
+ "required": [
721
+ "orderNumber"
722
+ ]
723
+ }
724
+ },
725
+ {
726
+ "name": "get_invoice",
727
+ "description": "The 綠界電子發票 invoice of an order: number, date, random code, allowances.",
728
+ "route": "invoices/get",
729
+ "permission": "plugins:manage",
730
+ "destructive": false,
731
+ "inputSchema": {
732
+ "$schema": "http://json-schema.org/draft-07/schema#",
733
+ "type": "object",
734
+ "properties": {
735
+ "orderNumber": {
736
+ "type": "string",
737
+ "minLength": 1,
738
+ "maxLength": 20,
739
+ "pattern": "^[A-Z0-9]+$"
740
+ }
741
+ },
742
+ "additionalProperties": true,
743
+ "required": [
744
+ "orderNumber"
745
+ ]
746
+ }
747
+ },
748
+ {
749
+ "name": "query_invoice",
750
+ "description": "Ask 綠界電子發票 for the invoice as it recorded it.",
751
+ "route": "invoices/query",
752
+ "permission": "plugins:manage",
753
+ "destructive": false,
754
+ "inputSchema": {
755
+ "$schema": "http://json-schema.org/draft-07/schema#",
756
+ "type": "object",
757
+ "properties": {
758
+ "orderNumber": {
759
+ "type": "string",
760
+ "minLength": 1,
761
+ "maxLength": 20,
762
+ "pattern": "^[A-Z0-9]+$"
763
+ }
764
+ },
765
+ "additionalProperties": true,
766
+ "required": [
767
+ "orderNumber"
768
+ ]
769
+ }
770
+ },
771
+ {
772
+ "name": "void_invoice",
773
+ "description": "Void an order's 綠界電子發票 invoice (its allowances are voided first).",
774
+ "route": "invoices/void",
775
+ "permission": "plugins:manage",
776
+ "destructive": true,
777
+ "inputSchema": {
778
+ "$schema": "http://json-schema.org/draft-07/schema#",
779
+ "type": "object",
780
+ "properties": {
781
+ "orderNumber": {
782
+ "type": "string",
783
+ "minLength": 1,
784
+ "maxLength": 20,
785
+ "pattern": "^[A-Z0-9]+$"
786
+ },
787
+ "reason": {
788
+ "type": "string",
789
+ "minLength": 1,
790
+ "maxLength": 50,
791
+ "default": "訂單取消"
792
+ }
793
+ },
794
+ "additionalProperties": true,
795
+ "required": [
796
+ "orderNumber"
797
+ ]
798
+ }
799
+ },
800
+ {
801
+ "name": "allowance_invoice",
802
+ "description": "Issue a 綠界電子發票 allowance (折讓, whole NT$) against an order's invoice.",
803
+ "route": "invoices/allowance",
804
+ "permission": "plugins:manage",
805
+ "destructive": true,
806
+ "inputSchema": {
807
+ "$schema": "http://json-schema.org/draft-07/schema#",
808
+ "type": "object",
809
+ "properties": {
810
+ "orderNumber": {
811
+ "type": "string",
812
+ "minLength": 1,
813
+ "maxLength": 20,
814
+ "pattern": "^[A-Z0-9]+$"
815
+ },
816
+ "amount": {
817
+ "type": "integer",
818
+ "minimum": 1,
819
+ "maximum": 99999999
820
+ },
821
+ "reason": {
822
+ "type": "string",
823
+ "minLength": 1,
824
+ "maxLength": 50,
825
+ "default": "折讓"
826
+ }
827
+ },
828
+ "additionalProperties": true,
829
+ "required": [
830
+ "orderNumber",
831
+ "amount"
832
+ ]
833
+ }
834
+ },
835
+ {
836
+ "name": "print_shipment_labels",
837
+ "description": "ECPay shipping labels for several shipments at once: one label page (HTML) per logistics subtype. mode A6 applies to 7-ELEVEN and post only; other subtypes print A4.",
838
+ "route": "shipments/print-batch",
839
+ "permission": "plugins:manage",
840
+ "destructive": false,
841
+ "inputSchema": {
842
+ "$schema": "http://json-schema.org/draft-07/schema#",
843
+ "type": "object",
844
+ "properties": {
845
+ "shipmentIds": {
846
+ "type": "array",
847
+ "items": {
848
+ "type": "string",
849
+ "minLength": 1,
850
+ "maxLength": 64
851
+ },
852
+ "minItems": 1,
853
+ "maxItems": 50
854
+ },
855
+ "mode": {
856
+ "enum": [
857
+ "A4",
858
+ "A6"
859
+ ]
860
+ }
861
+ },
862
+ "additionalProperties": true,
863
+ "required": [
864
+ "shipmentIds"
865
+ ]
866
+ }
867
+ },
868
+ {
869
+ "name": "refund_trade",
870
+ "description": "Refund a paid ECPay credit-card trade (whole NT$). An uncaptured charge can only be released in full. ATM / CVS payments must be refunded by hand.",
871
+ "route": "trades/refund",
872
+ "permission": "plugins:manage",
873
+ "destructive": true,
874
+ "inputSchema": {
875
+ "$schema": "http://json-schema.org/draft-07/schema#",
876
+ "type": "object",
877
+ "properties": {
878
+ "merchantTradeNo": {
879
+ "type": "string",
880
+ "minLength": 1,
881
+ "maxLength": 20,
882
+ "pattern": "^[A-Za-z0-9]+$"
883
+ },
884
+ "amount": {
885
+ "type": "integer",
886
+ "minimum": 1,
887
+ "maximum": 99999999
888
+ }
889
+ },
890
+ "additionalProperties": true,
891
+ "required": [
892
+ "merchantTradeNo",
893
+ "amount"
894
+ ]
895
+ }
896
+ }
897
+ ]
898
+ },
899
+ "admin": {
900
+ "settingsSchema": {
901
+ "environment": {
902
+ "label": "環境",
903
+ "type": "select",
904
+ "options": [
905
+ {
906
+ "value": "stage",
907
+ "label": "測試環境(stage)"
908
+ },
909
+ {
910
+ "value": "production",
911
+ "label": "正式環境"
912
+ }
913
+ ],
914
+ "default": "stage"
915
+ },
916
+ "merchantId": {
917
+ "label": "特店編號(MerchantID)",
918
+ "description": "測試環境留空時使用綠界公開測試帳號 3002607。",
919
+ "type": "string",
920
+ "default": ""
921
+ },
922
+ "hashKey": {
923
+ "label": "HashKey",
924
+ "type": "secret"
925
+ },
926
+ "hashIv": {
927
+ "label": "HashIV",
928
+ "type": "secret"
929
+ },
930
+ "methodCredit": {
931
+ "label": "信用卡",
932
+ "type": "boolean",
933
+ "default": true
934
+ },
935
+ "methodCredit3": {
936
+ "label": "信用卡分 3 期(需向綠界申請)",
937
+ "type": "boolean",
938
+ "default": false
939
+ },
940
+ "methodCredit6": {
941
+ "label": "信用卡分 6 期(需向綠界申請)",
942
+ "type": "boolean",
943
+ "default": false
944
+ },
945
+ "methodCredit12": {
946
+ "label": "信用卡分 12 期(需向綠界申請)",
947
+ "type": "boolean",
948
+ "default": false
949
+ },
950
+ "methodCredit18": {
951
+ "label": "信用卡分 18 期(需向綠界申請)",
952
+ "type": "boolean",
953
+ "default": false
954
+ },
955
+ "methodCredit24": {
956
+ "label": "信用卡分 24 期(需向綠界申請)",
957
+ "type": "boolean",
958
+ "default": false
959
+ },
960
+ "methodCredit30N": {
961
+ "label": "信用卡分 30 期(永豐,需向綠界申請)",
962
+ "type": "boolean",
963
+ "default": false
964
+ },
965
+ "credit30NMinAmount": {
966
+ "label": "永豐 30 期最低交易金額",
967
+ "description": "綠界廠商後台可查;訂單金額大於這個金額才提供 30 期。0 表示不提供。",
968
+ "type": "number",
969
+ "default": 0,
970
+ "min": 0
971
+ },
972
+ "methodUnionPay": {
973
+ "label": "銀聯卡(需向綠界申請)",
974
+ "type": "boolean",
975
+ "default": false
976
+ },
977
+ "creditRedeem": {
978
+ "label": "信用卡紅利折抵(需向綠界申請)",
979
+ "description": "一次付清的信用卡付款頁提供紅利折抵;分期與銀聯卡不適用。",
980
+ "type": "boolean",
981
+ "default": false
982
+ },
983
+ "methodATM": {
984
+ "label": "ATM 轉帳",
985
+ "type": "boolean",
986
+ "default": false
987
+ },
988
+ "methodCVS": {
989
+ "label": "超商代碼繳費",
990
+ "type": "boolean",
991
+ "default": false
992
+ },
993
+ "methodBARCODE": {
994
+ "label": "超商條碼繳費",
995
+ "type": "boolean",
996
+ "default": false
997
+ },
998
+ "methodWebATM": {
999
+ "label": "網路 ATM(手機版不支援)",
1000
+ "type": "boolean",
1001
+ "default": false
1002
+ },
1003
+ "methodApplePay": {
1004
+ "label": "Apple Pay",
1005
+ "type": "boolean",
1006
+ "default": false
1007
+ },
1008
+ "methodTWQR": {
1009
+ "label": "TWQR 行動支付(需申請,6–49,999 元)",
1010
+ "type": "boolean",
1011
+ "default": false
1012
+ },
1013
+ "methodBNPL": {
1014
+ "label": "無卡分期:裕富/中租(需申請,50–500,000 元)",
1015
+ "type": "boolean",
1016
+ "default": false
1017
+ },
1018
+ "methodWeiXin": {
1019
+ "label": "微信支付(需申請,6–500,000 元)",
1020
+ "type": "boolean",
1021
+ "default": false
1022
+ },
1023
+ "methodJkopay": {
1024
+ "label": "街口支付(需申請)",
1025
+ "type": "boolean",
1026
+ "default": false
1027
+ },
1028
+ "methodiPASS": {
1029
+ "label": "一卡通 iPASS MONEY(需申請)",
1030
+ "type": "boolean",
1031
+ "default": false
1032
+ },
1033
+ "methodALL": {
1034
+ "label": "綠界付款頁自選",
1035
+ "type": "boolean",
1036
+ "default": false
1037
+ },
1038
+ "atmExpireDays": {
1039
+ "label": "ATM 繳費期限(天)",
1040
+ "type": "number",
1041
+ "default": 3,
1042
+ "min": 1,
1043
+ "max": 60
1044
+ },
1045
+ "cvsExpireDays": {
1046
+ "label": "超商代碼繳費期限(天,最多 30)",
1047
+ "type": "number",
1048
+ "default": 7,
1049
+ "min": 1,
1050
+ "max": 30
1051
+ },
1052
+ "barcodeExpireDays": {
1053
+ "label": "超商條碼繳費期限(天,最多 30)",
1054
+ "type": "number",
1055
+ "default": 7,
1056
+ "min": 1,
1057
+ "max": 30
1058
+ },
1059
+ "orderPrefix": {
1060
+ "label": "訂單編號前綴(最多 5 個英數字)",
1061
+ "description": "多個商店共用同一個綠界帳號時,用前綴區分訂單編號。",
1062
+ "type": "string",
1063
+ "default": ""
1064
+ },
1065
+ "itemName": {
1066
+ "label": "付款頁顯示的商品名稱",
1067
+ "description": "留空時列出訂單的商品;填寫固定文字(例如「網路商品」)時每筆訂單都顯示這段文字。",
1068
+ "type": "string",
1069
+ "default": ""
1070
+ },
1071
+ "siteUrl": {
1072
+ "label": "網站網址",
1073
+ "description": "例:https://shop.example.com。物流狀態回呼使用;留空時沿用網站最近一次轉來的網址。",
1074
+ "type": "string",
1075
+ "default": ""
1076
+ },
1077
+ "logisticsEnabled": {
1078
+ "label": "啟用綠界物流",
1079
+ "type": "boolean",
1080
+ "default": false
1081
+ },
1082
+ "logisticsEnvironment": {
1083
+ "label": "物流環境",
1084
+ "type": "select",
1085
+ "options": [
1086
+ {
1087
+ "value": "stage",
1088
+ "label": "測試環境(stage)"
1089
+ },
1090
+ {
1091
+ "value": "production",
1092
+ "label": "正式環境"
1093
+ }
1094
+ ],
1095
+ "default": "stage"
1096
+ },
1097
+ "logisticsContract": {
1098
+ "label": "超商合約類型",
1099
+ "type": "select",
1100
+ "options": [
1101
+ {
1102
+ "value": "C2C",
1103
+ "label": "C2C 店到店"
1104
+ },
1105
+ {
1106
+ "value": "B2C",
1107
+ "label": "B2C 大宗寄倉"
1108
+ }
1109
+ ],
1110
+ "default": "C2C"
1111
+ },
1112
+ "logisticsC2cMerchantId": {
1113
+ "label": "C2C 物流特店編號",
1114
+ "description": "店到店(交貨便)用。測試環境未填時使用綠界公開測試帳號 2000933。",
1115
+ "type": "string",
1116
+ "default": ""
1117
+ },
1118
+ "logisticsC2cHashKey": {
1119
+ "label": "C2C 物流 HashKey",
1120
+ "type": "secret"
1121
+ },
1122
+ "logisticsC2cHashIv": {
1123
+ "label": "C2C 物流 HashIV",
1124
+ "type": "secret"
1125
+ },
1126
+ "logisticsB2cMerchantId": {
1127
+ "label": "B2C/宅配物流特店編號",
1128
+ "description": "大宗寄倉、黑貓、郵局用。測試環境未填時使用綠界公開測試帳號 2000132。",
1129
+ "type": "string",
1130
+ "default": ""
1131
+ },
1132
+ "logisticsB2cHashKey": {
1133
+ "label": "B2C/宅配物流 HashKey",
1134
+ "type": "secret"
1135
+ },
1136
+ "logisticsB2cHashIv": {
1137
+ "label": "B2C/宅配物流 HashIV",
1138
+ "type": "secret"
1139
+ },
1140
+ "cvsUnimart": {
1141
+ "label": "7-ELEVEN 取貨(B2C 可含冷凍,另拆一張冷凍單)",
1142
+ "type": "boolean",
1143
+ "default": true
1144
+ },
1145
+ "cvsFami": {
1146
+ "label": "全家取貨",
1147
+ "type": "boolean",
1148
+ "default": true
1149
+ },
1150
+ "cvsHilife": {
1151
+ "label": "萊爾富取貨",
1152
+ "type": "boolean",
1153
+ "default": false
1154
+ },
1155
+ "cvsOkmart": {
1156
+ "label": "OK 取貨",
1157
+ "type": "boolean",
1158
+ "default": false
1159
+ },
1160
+ "cvsUnimartFreeze": {
1161
+ "label": "7-ELEVEN 冷凍取貨(僅 B2C)",
1162
+ "type": "boolean",
1163
+ "default": false
1164
+ },
1165
+ "homeTcat": {
1166
+ "label": "黑貓宅急便(常溫/冷藏/冷凍,依溫層拆單)",
1167
+ "type": "boolean",
1168
+ "default": true
1169
+ },
1170
+ "homePost": {
1171
+ "label": "中華郵政(僅常溫)",
1172
+ "type": "boolean",
1173
+ "default": false
1174
+ },
1175
+ "cvsFee": {
1176
+ "label": "超商取貨運費",
1177
+ "type": "number",
1178
+ "default": 60,
1179
+ "min": 0
1180
+ },
1181
+ "homeFee": {
1182
+ "label": "宅配運費(常溫)",
1183
+ "type": "number",
1184
+ "default": 100,
1185
+ "min": 0
1186
+ },
1187
+ "coldFee": {
1188
+ "label": "低溫配送運費",
1189
+ "type": "number",
1190
+ "default": 160,
1191
+ "min": 0
1192
+ },
1193
+ "senderName": {
1194
+ "label": "寄件人姓名(最多 10 字)",
1195
+ "type": "string",
1196
+ "default": ""
1197
+ },
1198
+ "senderPhone": {
1199
+ "label": "寄件人電話",
1200
+ "type": "string",
1201
+ "default": ""
1202
+ },
1203
+ "senderCellphone": {
1204
+ "label": "寄件人手機",
1205
+ "type": "string",
1206
+ "default": ""
1207
+ },
1208
+ "senderZipcode": {
1209
+ "label": "寄件人郵遞區號(宅配用)",
1210
+ "description": "3、5 或 6 碼數字。留空時只採用寄件地址開頭的郵遞區號。",
1211
+ "type": "string",
1212
+ "default": ""
1213
+ },
1214
+ "senderAddress": {
1215
+ "label": "寄件地址(宅配用)",
1216
+ "description": "沒填郵遞區號時,地址開頭的 3–6 位數字當作郵遞區號。",
1217
+ "type": "string",
1218
+ "default": ""
1219
+ },
1220
+ "labelMode": {
1221
+ "label": "託運單格式",
1222
+ "description": "A6 只用於 7-ELEVEN(含冷凍)與中華郵政;全家、萊爾富、OK、黑貓沒有 A6,一律印 A4。",
1223
+ "type": "select",
1224
+ "options": [
1225
+ {
1226
+ "value": "1",
1227
+ "label": "A4"
1228
+ },
1229
+ {
1230
+ "value": "2",
1231
+ "label": "A6"
1232
+ }
1233
+ ],
1234
+ "default": "1"
1235
+ },
1236
+ "logisticsAutoShip": {
1237
+ "label": "付款後(貨到付款為下單後)自動建立物流單",
1238
+ "type": "boolean",
1239
+ "default": false
1240
+ },
1241
+ "invoiceEnabled": {
1242
+ "label": "啟用綠界電子發票",
1243
+ "type": "boolean",
1244
+ "default": false
1245
+ },
1246
+ "invoiceEnvironment": {
1247
+ "label": "發票環境",
1248
+ "type": "select",
1249
+ "options": [
1250
+ {
1251
+ "value": "stage",
1252
+ "label": "測試環境(stage)"
1253
+ },
1254
+ {
1255
+ "value": "production",
1256
+ "label": "正式環境"
1257
+ }
1258
+ ],
1259
+ "default": "stage"
1260
+ },
1261
+ "invoiceMerchantId": {
1262
+ "label": "發票特店編號",
1263
+ "description": "未填時使用綠界公開測試帳號 2000132(測試環境開立的發票不會上傳財政部)。",
1264
+ "type": "string",
1265
+ "default": ""
1266
+ },
1267
+ "invoiceHashKey": {
1268
+ "label": "發票 HashKey",
1269
+ "type": "secret"
1270
+ },
1271
+ "invoiceHashIv": {
1272
+ "label": "發票 HashIV",
1273
+ "type": "secret"
1274
+ },
1275
+ "invoicePrefix": {
1276
+ "label": "發票關聯編號前綴(最多 5 個英數字)",
1277
+ "description": "多個商店共用同一個綠界發票帳號時,用前綴區分。",
1278
+ "type": "string",
1279
+ "default": ""
1280
+ },
1281
+ "invoiceAuto": {
1282
+ "label": "自動開立",
1283
+ "type": "boolean",
1284
+ "default": true
1285
+ },
1286
+ "invoiceIssueWhen": {
1287
+ "label": "開立時機",
1288
+ "type": "select",
1289
+ "options": [
1290
+ {
1291
+ "value": "paid",
1292
+ "label": "付款完成(貨到付款於下單後)"
1293
+ },
1294
+ {
1295
+ "value": "completed",
1296
+ "label": "訂單完成(取貨完成)"
1297
+ }
1298
+ ],
1299
+ "default": "paid"
1300
+ },
1301
+ "invoiceDelayDays": {
1302
+ "label": "延後開立天數(0–30)",
1303
+ "type": "number",
1304
+ "default": 0,
1305
+ "min": 0,
1306
+ "max": 30
1307
+ },
1308
+ "invoiceAutoVoid": {
1309
+ "label": "訂單取消或全額退款時自動作廢",
1310
+ "type": "boolean",
1311
+ "default": false
1312
+ },
1313
+ "invoiceAutoAllowance": {
1314
+ "label": "部分退款時自動開立折讓",
1315
+ "type": "boolean",
1316
+ "default": false
1317
+ },
1318
+ "invoiceVerifyOnline": {
1319
+ "label": "結帳時向綠界驗證捐贈碼與手機條碼",
1320
+ "type": "boolean",
1321
+ "default": true
1322
+ },
1323
+ "invoiceAllowDonate": {
1324
+ "label": "結帳可選捐贈發票",
1325
+ "type": "boolean",
1326
+ "default": true
1327
+ },
1328
+ "invoiceAllowB2b": {
1329
+ "label": "結帳可打統編(三聯式)",
1330
+ "type": "boolean",
1331
+ "default": true
1332
+ },
1333
+ "invoiceChannelMember": {
1334
+ "label": "個人載具:綠界會員載具",
1335
+ "type": "boolean",
1336
+ "default": true
1337
+ },
1338
+ "invoiceChannelMobile": {
1339
+ "label": "個人載具:手機條碼",
1340
+ "type": "boolean",
1341
+ "default": true
1342
+ },
1343
+ "invoiceChannelCert": {
1344
+ "label": "個人載具:自然人憑證",
1345
+ "type": "boolean",
1346
+ "default": true
1347
+ },
1348
+ "invoiceChannelPaper": {
1349
+ "label": "個人載具:紙本發票",
1350
+ "description": "至少保留一種;全部取消時自動保留紙本。紙本發票請到綠界後台列印寄送。",
1351
+ "type": "boolean",
1352
+ "default": true
1353
+ },
1354
+ "invoiceDefaultCarrier": {
1355
+ "label": "預設的個人載具",
1356
+ "type": "select",
1357
+ "options": [
1358
+ {
1359
+ "value": "member",
1360
+ "label": "綠界會員載具"
1361
+ },
1362
+ {
1363
+ "value": "mobile",
1364
+ "label": "手機條碼"
1365
+ },
1366
+ {
1367
+ "value": "cert",
1368
+ "label": "自然人憑證"
1369
+ },
1370
+ {
1371
+ "value": "paper",
1372
+ "label": "紙本發票"
1373
+ }
1374
+ ],
1375
+ "default": "member"
1376
+ },
1377
+ "invoiceDonateOrgs": {
1378
+ "label": "捐贈單位(每行「名稱|愛心碼」)",
1379
+ "description": "例:伊甸社會福利基金會|25885。填寫後結帳改為下拉選單。",
1380
+ "type": "string",
1381
+ "default": ""
1382
+ },
1383
+ "busKey": {
1384
+ "label": "匯流排金鑰",
1385
+ "description": "由網站部署腳本寫入(scripts/provision-bus.mjs),請勿手動修改。",
1386
+ "type": "secret"
1387
+ }
1388
+ },
1389
+ "pages": [
1390
+ {
1391
+ "path": "/trades",
1392
+ "label": "綠界金流",
1393
+ "icon": "credit-card"
1394
+ },
1395
+ {
1396
+ "path": "/payment-labels",
1397
+ "label": "付款方式名稱與說明",
1398
+ "icon": "list"
1399
+ },
1400
+ {
1401
+ "path": "/shipments",
1402
+ "label": "綠界物流",
1403
+ "icon": "truck"
1404
+ },
1405
+ {
1406
+ "path": "/shipping-methods",
1407
+ "label": "物流方式設定",
1408
+ "icon": "list"
1409
+ },
1410
+ {
1411
+ "path": "/invoices",
1412
+ "label": "綠界電子發票",
1413
+ "icon": "receipt"
1414
+ }
1415
+ ],
1416
+ "widgets": []
1417
+ }
1418
+ }