-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathww-config.js
100 lines (100 loc) · 3.51 KB
/
ww-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
export default {
editor: {
settings: [
{
label: 'Configuration',
icon: 'advanced',
edit: () => import('./src/components/Configuration/SettingsEdit.vue'),
summary: () => import('./src/components/Configuration/SettingsSummary.vue'),
getIsValid(settings) {
const { publicApiKey } = settings.publicData;
const { privateApiKey } = settings.privateData;
return !!publicApiKey && !!privateApiKey;
},
},
],
designSystemId: '48b73e9d-9636-4e13-8125-f6433265a97d',
},
actions: [
{
name: 'Checkout',
code: 'checkout',
isAsync: true,
/* wwEditor:start */
edit: () => import('./src/components/Functions/Checkout.vue'),
getIsValid({ mode, paymentMethods, prices, successPage, cancelPage }) {
return (
!!mode &&
!!paymentMethods &&
!!paymentMethods.length &&
!!prices &&
!!prices.length &&
!!prices.every(({ price }) => !!price) &&
!!successPage &&
!!cancelPage
);
},
/* wwEditor:end */
},
{
name: 'Customer portal',
code: 'customerPortal',
isAsync: true,
/* wwEditor:start */
edit: () => import('./src/components/Functions/CustomerPortal.vue'),
getIsValid({ customerId, cancelPage }) {
return !!customerId && !!cancelPage;
},
/* wwEditor:end */
},
{
name: 'Create payment intent',
code: 'createPaymentIntent',
isAsync: true,
/* wwEditor:start */
edit: () => import('./src/components/Functions/CreatePaymentIntent.vue'),
getIsValid({ paymentMethods, prices }) {
return (
!!paymentMethods &&
!!paymentMethods.length &&
!!prices &&
((!!prices.length && !!prices.every(({ price }) => !!price)) || prices.__wwtype !== undefined)
);
},
/* wwEditor:end */
},
{
name: 'Retrieve payment intent',
code: 'retrievePaymentIntent',
isAsync: true,
/* wwEditor:start */
edit: () => import('./src/components/Functions/RetrievePaymentIntent.vue'),
getIsValid({ clientSecret }) {
return !!clientSecret;
},
/* wwEditor:end */
},
{
name: 'Confirm payment',
code: 'confirmPayment',
isAsync: true,
/* wwEditor:start */
edit: () => import('./src/components/Functions/ConfirmPayment.vue'),
getIsValid({ elementId, redirectPage }) {
return !!elementId && !!redirectPage;
},
/* wwEditor:end */
},
{
name: 'Confirm card payment',
code: 'confirmCardPayment',
isAsync: true,
/* wwEditor:start */
edit: () => import('./src/components/Functions/ConfirmCardPayment.vue'),
getIsValid({ clientSecret, elementId }) {
return !!clientSecret && !!elementId;
},
/* wwEditor:end */
},
],
};