ts-glitter 18.3.1 → 18.3.2

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.
@@ -419,267 +419,281 @@ export class ShoppingFinanceSetting {
419
419
  title: '金流設定',
420
420
  innerHTML: (gvc: GVC) => {
421
421
  try {
422
- return `<div>${(() => {
423
- switch (payData.key) {
424
- case 'newWebPay':
425
- case 'ecPay':
426
- return [
427
- BgWidget.inlineCheckBox({
428
- title: '串接路徑',
429
- gvc: gvc,
430
- def: key_d.ActionURL,
431
- array: (() => {
432
- if (payData.key === 'newWebPay') {
433
- return [
434
- {
435
- title: '正式站',
436
- value: 'https://core.newebpay.com/MPG/mpg_gateway',
437
- },
438
- {
439
- title: '測試站',
440
- value: 'https://ccore.newebpay.com/MPG/mpg_gateway',
441
- },
442
- ];
443
- } else {
444
- return [
445
- {
446
- title: '正式站',
447
- value: 'https://payment.ecpay.com.tw/Cashier/AioCheckOut/V5',
448
- },
449
- {
450
- title: '測試站',
451
- value: 'https://payment-stage.ecpay.com.tw/Cashier/AioCheckOut/V5',
452
- },
453
- ];
454
- }
455
- })(),
456
- callback: (text: any) => {
457
- key_d.ActionURL = text;
458
- },
459
- }),
460
- BgWidget.inlineCheckBox({
461
- title: '開通付款方式',
462
- gvc: gvc,
463
- def: ['credit', 'atm', 'web_atm', 'c_code', 'c_bar_code'].filter((dd) => {
464
- return (key_d as any)[dd];
422
+ return html`
423
+ ${BgWidget.editeInput({
424
+ gvc: gvc,
425
+ title: `<div>自訂金流名稱
426
+ ${BgWidget.grayNote('未輸入則參照預設')}
427
+ </div>`,
428
+ default: key_d.custome_name,
429
+ callback: (text) => {
430
+ key_d.custome_name = text;
431
+ },
432
+ placeHolder: '請輸入自訂顯示名稱',
433
+ global_language: true
434
+ })}
435
+ <div style="margin-top:-20px;">${(() => {
436
+ switch (payData.key) {
437
+ case 'newWebPay':
438
+ case 'ecPay':
439
+ return [
440
+ BgWidget.inlineCheckBox({
441
+ title: '串接路徑',
442
+ gvc: gvc,
443
+ def: key_d.ActionURL,
444
+ array: (() => {
445
+ if (payData.key === 'newWebPay') {
446
+ return [
447
+ {
448
+ title: '正式站',
449
+ value: 'https://core.newebpay.com/MPG/mpg_gateway',
450
+ },
451
+ {
452
+ title: '測試站',
453
+ value: 'https://ccore.newebpay.com/MPG/mpg_gateway',
454
+ },
455
+ ];
456
+ } else {
457
+ return [
458
+ {
459
+ title: '正式站',
460
+ value: 'https://payment.ecpay.com.tw/Cashier/AioCheckOut/V5',
461
+ },
462
+ {
463
+ title: '測試站',
464
+ value: 'https://payment-stage.ecpay.com.tw/Cashier/AioCheckOut/V5',
465
+ },
466
+ ];
467
+ }
468
+ })(),
469
+ callback: (text: any) => {
470
+ key_d.ActionURL = text;
471
+ },
465
472
  }),
466
- array: [
467
- {
468
- title: '信用卡',
469
- value: 'credit',
473
+ BgWidget.inlineCheckBox({
474
+ title: '開通付款方式',
475
+ gvc: gvc,
476
+ def: ['credit', 'atm', 'web_atm', 'c_code', 'c_bar_code'].filter((dd) => {
477
+ return (key_d as any)[dd];
478
+ }),
479
+ array: [
480
+ {
481
+ title: '信用卡',
482
+ value: 'credit',
483
+ },
484
+ {
485
+ title: '一般 ATM',
486
+ value: 'atm',
487
+ },
488
+ {
489
+ title: '網路 ATM',
490
+ value: 'web_atm',
491
+ },
492
+ {
493
+ title: '超商代碼',
494
+ value: 'c_code',
495
+ },
496
+ {
497
+ title: '超商條碼',
498
+ value: 'c_bar_code',
499
+ },
500
+ ],
501
+ callback: (array: any) => {
502
+ ['credit', 'atm', 'web_atm', 'c_code', 'c_bar_code'].map((dd) => {
503
+ (key_d as any)[dd] = !!array.find((d1: string) => {
504
+ return d1 === dd;
505
+ });
506
+ });
470
507
  },
471
- {
472
- title: '一般 ATM',
473
- value: 'atm',
508
+ type: 'multiple',
509
+ }),
510
+ BgWidget.editeInput({
511
+ gvc: gvc,
512
+ title: '特店編號',
513
+ default: key_d.MERCHANT_ID,
514
+ callback: (text) => {
515
+ key_d.MERCHANT_ID = text;
474
516
  },
475
- {
476
- title: '網路 ATM',
477
- value: 'web_atm',
517
+ placeHolder: '請輸入特店編號',
518
+ }),
519
+ BgWidget.editeInput({
520
+ gvc: gvc,
521
+ title: 'HASH_KEY',
522
+ default: key_d.HASH_KEY,
523
+ callback: (text) => {
524
+ key_d.HASH_KEY = text;
478
525
  },
479
- {
480
- title: '超商代碼',
481
- value: 'c_code',
526
+ placeHolder: '請輸入HASH_KEY',
527
+ }),
528
+ BgWidget.editeInput({
529
+ gvc: gvc,
530
+ title: 'HASH_IV',
531
+ default: key_d.HASH_IV,
532
+ callback: (text) => {
533
+ key_d.HASH_IV = text;
482
534
  },
483
- {
484
- title: '超商條碼',
485
- value: 'c_bar_code',
535
+ placeHolder: '請輸入HASH_IV',
536
+ }),
537
+ BgWidget.editeInput({
538
+ gvc: gvc,
539
+ title: '信用卡授權檢查碼',
540
+ default: key_d.CreditCheckCode,
541
+ callback: (text) => {
542
+ key_d.CreditCheckCode = text;
486
543
  },
487
- ],
488
- callback: (array: any) => {
489
- ['credit', 'atm', 'web_atm', 'c_code', 'c_bar_code'].map((dd) => {
490
- (key_d as any)[dd] = !!array.find((d1: string) => {
491
- return d1 === dd;
492
- });
493
- });
494
- },
495
- type: 'multiple',
496
- }),
497
- BgWidget.editeInput({
498
- gvc: gvc,
499
- title: '特店編號',
500
- default: key_d.MERCHANT_ID,
501
- callback: (text) => {
502
- key_d.MERCHANT_ID = text;
503
- },
504
- placeHolder: '請輸入特店編號',
505
- }),
506
- BgWidget.editeInput({
507
- gvc: gvc,
508
- title: 'HASH_KEY',
509
- default: key_d.HASH_KEY,
510
- callback: (text) => {
511
- key_d.HASH_KEY = text;
512
- },
513
- placeHolder: '請輸入HASH_KEY',
514
- }),
515
- BgWidget.editeInput({
516
- gvc: gvc,
517
- title: 'HASH_IV',
518
- default: key_d.HASH_IV,
519
- callback: (text) => {
520
- key_d.HASH_IV = text;
521
- },
522
- placeHolder: '請輸入HASH_IV',
523
- }),
524
- BgWidget.editeInput({
525
- gvc: gvc,
526
- title: '信用卡授權檢查碼',
527
- default: key_d.CreditCheckCode,
528
- callback: (text) => {
529
- key_d.CreditCheckCode = text;
530
- },
531
- placeHolder: '請輸入信用卡檢查碼',
532
- }),
533
- ].join('');
534
- case 'paypal':
535
- return [
536
- BgWidget.inlineCheckBox({
537
- title: '串接路徑',
538
- gvc: gvc,
539
- def: `${key_d.BETA}`,
540
- array: [
541
- {
542
- title: '正式站',
543
- value: `false`,
544
+ placeHolder: '請輸入信用卡檢查碼',
545
+ }),
546
+ ].join('');
547
+ case 'paypal':
548
+ return [
549
+ BgWidget.inlineCheckBox({
550
+ title: '串接路徑',
551
+ gvc: gvc,
552
+ def: `${key_d.BETA}`,
553
+ array: [
554
+ {
555
+ title: '正式站',
556
+ value: `false`,
557
+ },
558
+ {
559
+ title: '測試站',
560
+ value: `true`,
561
+ },
562
+ ],
563
+ callback: (text: any) => {
564
+ key_d.BETA = text;
544
565
  },
545
- {
546
- title: '測試站',
547
- value: `true`,
566
+ }),
567
+ BgWidget.editeInput({
568
+ gvc: gvc,
569
+ title: 'CLIENT_ID',
570
+ default: key_d.PAYPAL_CLIENT_ID,
571
+ callback: (text) => {
572
+ key_d.PAYPAL_CLIENT_ID = text;
548
573
  },
549
- ],
550
- callback: (text: any) => {
551
- key_d.BETA = text;
552
- },
553
- }),
554
- BgWidget.editeInput({
555
- gvc: gvc,
556
- title: 'CLIENT_ID',
557
- default: key_d.PAYPAL_CLIENT_ID,
558
- callback: (text) => {
559
- key_d.PAYPAL_CLIENT_ID = text;
560
- },
561
- placeHolder: '請輸入CLIENT_ID',
562
- }),
563
- BgWidget.editeInput({
564
- gvc: gvc,
565
- title: 'SECRET',
566
- default: key_d.PAYPAL_SECRET,
567
- callback: (text) => {
568
- key_d.PAYPAL_SECRET = text;
569
- },
570
- placeHolder: '請輸入SECRET',
571
- }),
572
- ].join('')
573
- case 'line_pay':
574
- return [
575
- BgWidget.inlineCheckBox({
576
- title: '串接路徑',
577
- gvc: gvc,
578
- def: `${key_d.BETA}`,
579
- array: [
580
- {
581
- title: '正式站',
582
- value: `false`,
574
+ placeHolder: '請輸入CLIENT_ID',
575
+ }),
576
+ BgWidget.editeInput({
577
+ gvc: gvc,
578
+ title: 'SECRET',
579
+ default: key_d.PAYPAL_SECRET,
580
+ callback: (text) => {
581
+ key_d.PAYPAL_SECRET = text;
583
582
  },
584
- {
585
- title: '測試站',
586
- value: `true`,
583
+ placeHolder: '請輸入SECRET',
584
+ }),
585
+ ].join('')
586
+ case 'line_pay':
587
+ return [
588
+ BgWidget.inlineCheckBox({
589
+ title: '串接路徑',
590
+ gvc: gvc,
591
+ def: `${key_d.BETA}`,
592
+ array: [
593
+ {
594
+ title: '正式站',
595
+ value: `false`,
596
+ },
597
+ {
598
+ title: '測試站',
599
+ value: `true`,
600
+ },
601
+ ],
602
+ callback: (text: any) => {
603
+ key_d.BETA = text;
587
604
  },
588
- ],
589
- callback: (text: any) => {
590
- key_d.BETA = text;
591
- },
592
- }),
593
- BgWidget.editeInput({
594
- gvc: gvc,
595
- title: 'CLIENT_ID',
596
- default: key_d.CLIENT_ID,
597
- callback: (text) => {
598
- key_d.CLIENT_ID = text;
599
- },
600
- placeHolder: '請輸入CLIENT_ID',
601
- }),
602
- BgWidget.editeInput({
603
- gvc: gvc,
604
- title: 'SECRET',
605
- default: key_d.SECRET,
606
- callback: (text) => {
607
- key_d.SECRET = text;
608
- },
609
- placeHolder: '請輸入SECRET',
610
- }),
611
- ].join('')
612
- case 'jkopay':
613
- return [
614
- BgWidget.editeInput({
615
- gvc: gvc,
616
- title: 'STORE_ID',
617
- default: key_d.STORE_ID,
618
- callback: (text) => {
619
- key_d.STORE_ID = text;
620
- },
621
- placeHolder: '請輸入STORE_ID',
622
- }),
623
- BgWidget.editeInput({
624
- gvc: gvc,
625
- title: 'API_KEY',
626
- default: key_d.API_KEY,
627
- callback: (text) => {
628
- key_d.API_KEY = text;
629
- },
630
- placeHolder: '請輸入API_KEY',
631
- }),
632
- BgWidget.editeInput({
633
- gvc: gvc,
634
- title: 'SECRET',
635
- default: key_d.SECRET_KEY,
636
- callback: (text) => {
637
- key_d.SECRET_KEY = text;
638
- },
639
- placeHolder: '請輸入SECRET_KEY',
640
- }),
641
- ].join('')
642
- case 'paynow':
643
- return [
644
- BgWidget.inlineCheckBox({
645
- title: '串接路徑',
646
- gvc: gvc,
647
- def: `${key_d.BETA}`,
648
- array: [
649
- {
650
- title: '正式站',
651
- value: `false`,
605
+ }),
606
+ BgWidget.editeInput({
607
+ gvc: gvc,
608
+ title: 'CLIENT_ID',
609
+ default: key_d.CLIENT_ID,
610
+ callback: (text) => {
611
+ key_d.CLIENT_ID = text;
652
612
  },
653
- {
654
- title: '測試站',
655
- value: `true`,
613
+ placeHolder: '請輸入CLIENT_ID',
614
+ }),
615
+ BgWidget.editeInput({
616
+ gvc: gvc,
617
+ title: 'SECRET',
618
+ default: key_d.SECRET,
619
+ callback: (text) => {
620
+ key_d.SECRET = text;
656
621
  },
657
- ],
658
- callback: (text: any) => {
659
- key_d.BETA = text;
660
- },
661
- }),
662
- BgWidget.editeInput({
663
- gvc: gvc,
664
- title: '串接帳號',
665
- default: key_d.account,
666
- callback: (text) => {
667
- key_d.account = text;
668
- },
669
- placeHolder: '請輸入串接帳號',
670
- }),
671
- BgWidget.editeInput({
672
- gvc: gvc,
673
- title: '串接密碼',
674
- default: key_d.pwd,
675
- callback: (text) => {
676
- key_d.pwd = text;
677
- },
678
- placeHolder: '請輸入串接密碼',
679
- })].join('');
680
- }
681
- return ``
682
- })()}</div>`
622
+ placeHolder: '請輸入SECRET',
623
+ }),
624
+ ].join('')
625
+ case 'jkopay':
626
+ return [
627
+ BgWidget.editeInput({
628
+ gvc: gvc,
629
+ title: 'STORE_ID',
630
+ default: key_d.STORE_ID,
631
+ callback: (text) => {
632
+ key_d.STORE_ID = text;
633
+ },
634
+ placeHolder: '請輸入STORE_ID',
635
+ }),
636
+ BgWidget.editeInput({
637
+ gvc: gvc,
638
+ title: 'API_KEY',
639
+ default: key_d.API_KEY,
640
+ callback: (text) => {
641
+ key_d.API_KEY = text;
642
+ },
643
+ placeHolder: '請輸入API_KEY',
644
+ }),
645
+ BgWidget.editeInput({
646
+ gvc: gvc,
647
+ title: 'SECRET',
648
+ default: key_d.SECRET_KEY,
649
+ callback: (text) => {
650
+ key_d.SECRET_KEY = text;
651
+ },
652
+ placeHolder: '請輸入SECRET_KEY',
653
+ }),
654
+ ].join('')
655
+ case 'paynow':
656
+ return [
657
+ BgWidget.inlineCheckBox({
658
+ title: '串接路徑',
659
+ gvc: gvc,
660
+ def: `${key_d.BETA}`,
661
+ array: [
662
+ {
663
+ title: '正式站',
664
+ value: `false`,
665
+ },
666
+ {
667
+ title: '測試站',
668
+ value: `true`,
669
+ },
670
+ ],
671
+ callback: (text: any) => {
672
+ key_d.BETA = text;
673
+ },
674
+ }),
675
+ BgWidget.editeInput({
676
+ gvc: gvc,
677
+ title: '串接帳號',
678
+ default: key_d.account,
679
+ callback: (text) => {
680
+ key_d.account = text;
681
+ },
682
+ placeHolder: '請輸入串接帳號',
683
+ }),
684
+ BgWidget.editeInput({
685
+ gvc: gvc,
686
+ title: '串接密碼',
687
+ default: key_d.pwd,
688
+ callback: (text) => {
689
+ key_d.pwd = text;
690
+ },
691
+ placeHolder: '請輸入串接密碼',
692
+ })].join('');
693
+ }
694
+ return ``
695
+ })()}
696
+ </div>`
683
697
  } catch (e) {
684
698
  console.error(e)
685
699
  return `${e}`
@@ -2219,25 +2233,25 @@ ${BgWidget.greenNote('支援四大超商/黑貓')}
2219
2233
  html`
2220
2234
  <div
2221
2235
  onclick="${gvc.event(() => {
2222
- const dialog = new ShareDialog(gvc.glitter);
2223
- (window.parent as any).navigator.clipboard.writeText((window.parent as any).saasConfig.config.url+ `/api-public/v1/delivery/notify?g-app=${(window.parent as any).appName}`);
2224
- dialog.successMessage({text: '已複製至剪貼簿'});
2225
- })}"
2236
+ const dialog = new ShareDialog(gvc.glitter);
2237
+ (window.parent as any).navigator.clipboard.writeText((window.parent as any).saasConfig.config.url + `/api-public/v1/delivery/notify?g-app=${(window.parent as any).appName}`);
2238
+ dialog.successMessage({text: '已複製至剪貼簿'});
2239
+ })}"
2226
2240
  >
2227
2241
  ${BgWidget.editeInput({
2228
- readonly: true,
2229
- gvc: gvc,
2230
- title: html`
2242
+ readonly: true,
2243
+ gvc: gvc,
2244
+ title: html`
2231
2245
  <div class="d-flex flex-column"
2232
2246
  style="gap:5px;">
2233
- 物流追蹤通知
2247
+ 物流追蹤通知
2234
2248
  ${BgWidget.grayNote('點擊複製此連結至PAYNOW後台的貨態回傳網址')}
2235
2249
  </div>`,
2236
- default: (window.parent as any).saasConfig.config.url+ `/api-public/v1/delivery/notify?g-app=${(window.parent as any).appName}`,
2237
- placeHolder: '',
2238
- callback: (text) => {
2239
- },
2240
- })}
2250
+ default: (window.parent as any).saasConfig.config.url + `/api-public/v1/delivery/notify?g-app=${(window.parent as any).appName}`,
2251
+ placeHolder: '',
2252
+ callback: (text) => {
2253
+ },
2254
+ })}
2241
2255
  </div>`,
2242
2256
  BgWidget.editeInput({
2243
2257
  gvc: gvc,