@authvia/payment-method-create 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.
- package/README.md +336 -0
- package/dist/components/AuthviaPaymentMethodForm.vue.d.ts +65 -0
- package/dist/components/icons/authvia-wallet-svg-icon.vue.d.ts +30 -0
- package/dist/components/internal/AuthviaForgotCardOption.vue.d.ts +11 -0
- package/dist/components/internal/AuthviaFormWithTerms.vue.d.ts +2 -0
- package/dist/components/internal/AuthviaPaymentMethodAddAch.vue.d.ts +187 -0
- package/dist/components/internal/AuthviaPaymentMethodAddAchOnline.vue.d.ts +25 -0
- package/dist/components/internal/AuthviaPaymentMethodAddAchOptions.vue.d.ts +42 -0
- package/dist/components/internal/AuthviaPaymentMethodCard.vue.d.ts +22 -0
- package/dist/components/internal/AuthviaPaymentMethodCreditCard.vue.d.ts +142 -0
- package/dist/components/internal/AuthviaPaymentMethodRestrictions.vue.d.ts +41 -0
- package/dist/components/internal/AuthviaPazeForm.vue.d.ts +48 -0
- package/dist/components/internal/AuthviaPciFooter.vue.d.ts +5 -0
- package/dist/composables/useHostService.d.ts +22 -0
- package/dist/composables/usePaymentMethodService.d.ts +34 -0
- package/dist/composables/usePazeSDK.d.ts +21 -0
- package/dist/composables/useWalletMerchantService.d.ts +15 -0
- package/dist/composables/useWalletTokenService.d.ts +16 -0
- package/dist/entry/index.d.ts +13 -0
- package/dist/entry/web-component.d.ts +92 -0
- package/dist/model/APIOptions.d.ts +3 -0
- package/dist/model/Contact.d.ts +8 -0
- package/dist/model/Merchant.d.ts +8 -0
- package/dist/model/MerchantProductSummary.d.ts +6 -0
- package/dist/model/MerchantProfile.d.ts +22 -0
- package/dist/model/MerchantTheme.d.ts +5 -0
- package/dist/model/PaymentMethod.d.ts +65 -0
- package/dist/model/PaymentMethodAPIError.d.ts +18 -0
- package/dist/model/PaymentMethodBillingAddress.d.ts +15 -0
- package/dist/model/PaymentMethodFilters.d.ts +4 -0
- package/dist/model/TokenGrants.d.ts +14 -0
- package/dist/model/index.d.ts +11 -0
- package/dist/plugins/vuetify-base.d.ts +169 -0
- package/dist/svg/index.d.ts +22 -0
- package/dist/types/index.d.ts +197 -0
- package/dist/utils/apiBaseUrl.d.ts +7 -0
- package/dist/utils/config.d.ts +40 -0
- package/dist/utils/errors.d.ts +32 -0
- package/dist/utils/index.d.ts +69 -0
- package/dist/utils/logger.d.ts +6 -0
- package/dist/utils/spacing.d.ts +39 -0
- package/dist/utils/tokenUtils.d.ts +43 -0
- package/dist/vue-plugin.d.ts +6 -0
- package/dist/vue-plugin.js +2 -0
- package/dist/vue-plugin.umd.cjs +2 -0
- package/dist/walletConstants.d.ts +8 -0
- package/package.json +136 -0
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export interface PaymentMethodBillingAddress {
|
|
2
|
+
country?: string;
|
|
3
|
+
state?: string;
|
|
4
|
+
city?: string;
|
|
5
|
+
streetAddress?: string;
|
|
6
|
+
zipCode?: string;
|
|
7
|
+
postalCode?: string;
|
|
8
|
+
countryCode?: string;
|
|
9
|
+
name?: string;
|
|
10
|
+
/** Demo prefill for ACH: routing number (8–9 digits). */
|
|
11
|
+
routingNumber?: string;
|
|
12
|
+
/** Demo prefill for ACH: account number (1–17 digits). */
|
|
13
|
+
accountNumber?: string;
|
|
14
|
+
isEditable?: boolean;
|
|
15
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export interface TokenGrants {
|
|
2
|
+
sub: string;
|
|
3
|
+
azp: string;
|
|
4
|
+
aud: string;
|
|
5
|
+
iss: string;
|
|
6
|
+
jti: string;
|
|
7
|
+
scope: string;
|
|
8
|
+
iat: number;
|
|
9
|
+
exp: number;
|
|
10
|
+
'https://authvia.com/role': string;
|
|
11
|
+
'https://authvia.com/uuid': string;
|
|
12
|
+
'https://authvia.com/businessProcess': string;
|
|
13
|
+
[key: string]: number | string | boolean;
|
|
14
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export * from './APIOptions';
|
|
2
|
+
export * from './PaymentMethod';
|
|
3
|
+
export * from './PaymentMethodFilters';
|
|
4
|
+
export * from './PaymentMethodAPIError';
|
|
5
|
+
export * from './PaymentMethodBillingAddress';
|
|
6
|
+
export * from './MerchantProfile';
|
|
7
|
+
export * from './MerchantTheme';
|
|
8
|
+
export * from './Contact';
|
|
9
|
+
export * from './Merchant';
|
|
10
|
+
export * from './MerchantProductSummary';
|
|
11
|
+
export * from './TokenGrants';
|
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
export declare const createVuetifyInstance: () => {
|
|
2
|
+
install: (app: import('vue').App<any>) => void;
|
|
3
|
+
unmount: () => void;
|
|
4
|
+
defaults: import('vue').Ref<import('vuetify').DefaultsInstance, import('vuetify').DefaultsInstance>;
|
|
5
|
+
display: import('vuetify').DisplayInstance;
|
|
6
|
+
theme: import('vuetify').ThemeInstance & {
|
|
7
|
+
install: (app: import('vue').App<any>) => void;
|
|
8
|
+
};
|
|
9
|
+
icons: {
|
|
10
|
+
defaultSet: string;
|
|
11
|
+
aliases: Partial<import('vuetify').IconAliases>;
|
|
12
|
+
sets: Record<string, import('vuetify').IconSet>;
|
|
13
|
+
};
|
|
14
|
+
locale: {
|
|
15
|
+
name: string;
|
|
16
|
+
decimalSeparator: import('vue').ShallowRef<string>;
|
|
17
|
+
messages: import('vue').Ref<import('vuetify').LocaleMessages, import('vuetify').LocaleMessages>;
|
|
18
|
+
current: import('vue').Ref<string, string>;
|
|
19
|
+
fallback: import('vue').Ref<string, string>;
|
|
20
|
+
t: (key: string, ...params: unknown[]) => string;
|
|
21
|
+
n: (value: number) => string;
|
|
22
|
+
provide: (props: import('vuetify').LocaleOptions) => import('vuetify').LocaleInstance;
|
|
23
|
+
isRtl: import('vue').Ref<boolean, boolean>;
|
|
24
|
+
rtl: import('vue').Ref<Record<string, boolean>, Record<string, boolean>>;
|
|
25
|
+
rtlClasses: import('vue').Ref<string, string>;
|
|
26
|
+
};
|
|
27
|
+
date: {
|
|
28
|
+
options: {
|
|
29
|
+
adapter: (new (options: {
|
|
30
|
+
locale: any;
|
|
31
|
+
formats?: any;
|
|
32
|
+
}) => import('vuetify').DateInstance) | import('vuetify').DateInstance;
|
|
33
|
+
formats?: Record<string, any>;
|
|
34
|
+
locale: Record<string, any>;
|
|
35
|
+
};
|
|
36
|
+
instance: {
|
|
37
|
+
date: (value?: any) => unknown;
|
|
38
|
+
format: (date: unknown, formatString: string) => string;
|
|
39
|
+
toJsDate: (value: unknown) => Date;
|
|
40
|
+
parseISO: (date: string) => unknown;
|
|
41
|
+
toISO: (date: unknown) => string;
|
|
42
|
+
startOfDay: (date: unknown) => unknown;
|
|
43
|
+
endOfDay: (date: unknown) => unknown;
|
|
44
|
+
startOfWeek: (date: unknown, firstDayOfWeek?: string | number | undefined) => unknown;
|
|
45
|
+
endOfWeek: (date: unknown) => unknown;
|
|
46
|
+
startOfMonth: (date: unknown) => unknown;
|
|
47
|
+
endOfMonth: (date: unknown) => unknown;
|
|
48
|
+
startOfYear: (date: unknown) => unknown;
|
|
49
|
+
endOfYear: (date: unknown) => unknown;
|
|
50
|
+
isAfter: (date: unknown, comparing: unknown) => boolean;
|
|
51
|
+
isAfterDay: (date: unknown, comparing: unknown) => boolean;
|
|
52
|
+
isSameDay: (date: unknown, comparing: unknown) => boolean;
|
|
53
|
+
isSameMonth: (date: unknown, comparing: unknown) => boolean;
|
|
54
|
+
isSameYear: (date: unknown, comparing: unknown) => boolean;
|
|
55
|
+
isBefore: (date: unknown, comparing: unknown) => boolean;
|
|
56
|
+
isEqual: (date: unknown, comparing: unknown) => boolean;
|
|
57
|
+
isValid: (date: any) => boolean;
|
|
58
|
+
isWithinRange: (date: unknown, range: [unknown, unknown]) => boolean;
|
|
59
|
+
addMinutes: (date: unknown, amount: number) => unknown;
|
|
60
|
+
addHours: (date: unknown, amount: number) => unknown;
|
|
61
|
+
addDays: (date: unknown, amount: number) => unknown;
|
|
62
|
+
addWeeks: (date: unknown, amount: number) => unknown;
|
|
63
|
+
addMonths: (date: unknown, amount: number) => unknown;
|
|
64
|
+
getYear: (date: unknown) => number;
|
|
65
|
+
setYear: (date: unknown, year: number) => unknown;
|
|
66
|
+
getDiff: (date: unknown, comparing: unknown, unit?: string | undefined) => number;
|
|
67
|
+
getWeekArray: (date: unknown, firstDayOfWeek?: string | number | undefined) => unknown[][];
|
|
68
|
+
getWeekdays: (firstDayOfWeek?: string | number | undefined, weekdayFormat?: "long" | "narrow" | "short" | undefined) => string[];
|
|
69
|
+
getWeek: (date: unknown, firstDayOfWeek?: string | number | undefined, firstDayOfYear?: string | number | undefined) => number;
|
|
70
|
+
getMonth: (date: unknown) => number;
|
|
71
|
+
setMonth: (date: unknown, month: number) => unknown;
|
|
72
|
+
getDate: (date: unknown) => number;
|
|
73
|
+
setDate: (date: unknown, day: number) => unknown;
|
|
74
|
+
getNextMonth: (date: unknown) => unknown;
|
|
75
|
+
getPreviousMonth: (date: unknown) => unknown;
|
|
76
|
+
getHours: (date: unknown) => number;
|
|
77
|
+
setHours: (date: unknown, hours: number) => unknown;
|
|
78
|
+
getMinutes: (date: unknown) => number;
|
|
79
|
+
setMinutes: (date: unknown, minutes: number) => unknown;
|
|
80
|
+
locale?: any;
|
|
81
|
+
};
|
|
82
|
+
};
|
|
83
|
+
goTo: import('vuetify').GoToInstance;
|
|
84
|
+
};
|
|
85
|
+
declare const _default: {
|
|
86
|
+
install: (app: import('vue').App<any>) => void;
|
|
87
|
+
unmount: () => void;
|
|
88
|
+
defaults: import('vue').Ref<import('vuetify').DefaultsInstance, import('vuetify').DefaultsInstance>;
|
|
89
|
+
display: import('vuetify').DisplayInstance;
|
|
90
|
+
theme: import('vuetify').ThemeInstance & {
|
|
91
|
+
install: (app: import('vue').App<any>) => void;
|
|
92
|
+
};
|
|
93
|
+
icons: {
|
|
94
|
+
defaultSet: string;
|
|
95
|
+
aliases: Partial<import('vuetify').IconAliases>;
|
|
96
|
+
sets: Record<string, import('vuetify').IconSet>;
|
|
97
|
+
};
|
|
98
|
+
locale: {
|
|
99
|
+
name: string;
|
|
100
|
+
decimalSeparator: import('vue').ShallowRef<string>;
|
|
101
|
+
messages: import('vue').Ref<import('vuetify').LocaleMessages, import('vuetify').LocaleMessages>;
|
|
102
|
+
current: import('vue').Ref<string, string>;
|
|
103
|
+
fallback: import('vue').Ref<string, string>;
|
|
104
|
+
t: (key: string, ...params: unknown[]) => string;
|
|
105
|
+
n: (value: number) => string;
|
|
106
|
+
provide: (props: import('vuetify').LocaleOptions) => import('vuetify').LocaleInstance;
|
|
107
|
+
isRtl: import('vue').Ref<boolean, boolean>;
|
|
108
|
+
rtl: import('vue').Ref<Record<string, boolean>, Record<string, boolean>>;
|
|
109
|
+
rtlClasses: import('vue').Ref<string, string>;
|
|
110
|
+
};
|
|
111
|
+
date: {
|
|
112
|
+
options: {
|
|
113
|
+
adapter: (new (options: {
|
|
114
|
+
locale: any;
|
|
115
|
+
formats?: any;
|
|
116
|
+
}) => import('vuetify').DateInstance) | import('vuetify').DateInstance;
|
|
117
|
+
formats?: Record<string, any>;
|
|
118
|
+
locale: Record<string, any>;
|
|
119
|
+
};
|
|
120
|
+
instance: {
|
|
121
|
+
date: (value?: any) => unknown;
|
|
122
|
+
format: (date: unknown, formatString: string) => string;
|
|
123
|
+
toJsDate: (value: unknown) => Date;
|
|
124
|
+
parseISO: (date: string) => unknown;
|
|
125
|
+
toISO: (date: unknown) => string;
|
|
126
|
+
startOfDay: (date: unknown) => unknown;
|
|
127
|
+
endOfDay: (date: unknown) => unknown;
|
|
128
|
+
startOfWeek: (date: unknown, firstDayOfWeek?: string | number | undefined) => unknown;
|
|
129
|
+
endOfWeek: (date: unknown) => unknown;
|
|
130
|
+
startOfMonth: (date: unknown) => unknown;
|
|
131
|
+
endOfMonth: (date: unknown) => unknown;
|
|
132
|
+
startOfYear: (date: unknown) => unknown;
|
|
133
|
+
endOfYear: (date: unknown) => unknown;
|
|
134
|
+
isAfter: (date: unknown, comparing: unknown) => boolean;
|
|
135
|
+
isAfterDay: (date: unknown, comparing: unknown) => boolean;
|
|
136
|
+
isSameDay: (date: unknown, comparing: unknown) => boolean;
|
|
137
|
+
isSameMonth: (date: unknown, comparing: unknown) => boolean;
|
|
138
|
+
isSameYear: (date: unknown, comparing: unknown) => boolean;
|
|
139
|
+
isBefore: (date: unknown, comparing: unknown) => boolean;
|
|
140
|
+
isEqual: (date: unknown, comparing: unknown) => boolean;
|
|
141
|
+
isValid: (date: any) => boolean;
|
|
142
|
+
isWithinRange: (date: unknown, range: [unknown, unknown]) => boolean;
|
|
143
|
+
addMinutes: (date: unknown, amount: number) => unknown;
|
|
144
|
+
addHours: (date: unknown, amount: number) => unknown;
|
|
145
|
+
addDays: (date: unknown, amount: number) => unknown;
|
|
146
|
+
addWeeks: (date: unknown, amount: number) => unknown;
|
|
147
|
+
addMonths: (date: unknown, amount: number) => unknown;
|
|
148
|
+
getYear: (date: unknown) => number;
|
|
149
|
+
setYear: (date: unknown, year: number) => unknown;
|
|
150
|
+
getDiff: (date: unknown, comparing: unknown, unit?: string | undefined) => number;
|
|
151
|
+
getWeekArray: (date: unknown, firstDayOfWeek?: string | number | undefined) => unknown[][];
|
|
152
|
+
getWeekdays: (firstDayOfWeek?: string | number | undefined, weekdayFormat?: "long" | "narrow" | "short" | undefined) => string[];
|
|
153
|
+
getWeek: (date: unknown, firstDayOfWeek?: string | number | undefined, firstDayOfYear?: string | number | undefined) => number;
|
|
154
|
+
getMonth: (date: unknown) => number;
|
|
155
|
+
setMonth: (date: unknown, month: number) => unknown;
|
|
156
|
+
getDate: (date: unknown) => number;
|
|
157
|
+
setDate: (date: unknown, day: number) => unknown;
|
|
158
|
+
getNextMonth: (date: unknown) => unknown;
|
|
159
|
+
getPreviousMonth: (date: unknown) => unknown;
|
|
160
|
+
getHours: (date: unknown) => number;
|
|
161
|
+
setHours: (date: unknown, hours: number) => unknown;
|
|
162
|
+
getMinutes: (date: unknown) => number;
|
|
163
|
+
setMinutes: (date: unknown, minutes: number) => unknown;
|
|
164
|
+
locale?: any;
|
|
165
|
+
};
|
|
166
|
+
};
|
|
167
|
+
goTo: import('vuetify').GoToInstance;
|
|
168
|
+
};
|
|
169
|
+
export default _default;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
Path values of svg files
|
|
3
|
+
*/
|
|
4
|
+
export declare const svgClose = "M19,6.41L17.59,5L12,10.59L6.41,5L5,6.41L10.59,12L5,17.59L6.41,19L12,13.41L17.59,19L19,17.59L13.41,12L19,6.41Z";
|
|
5
|
+
export declare const svgDelete = "M19,4H15.5L14.5,3H9.5L8.5,4H5V6H19M6,19A2,2 0 0,0 8,21H16A2,2 0 0,0 18,19V7H6V19Z";
|
|
6
|
+
export declare const svgCreditCard = "M20 8H4V6h16m0 12H4v-6h16m0-8H4c-1.11 0-2 .89-2 2v12a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V6a2 2 0 0 0-2-2Z";
|
|
7
|
+
export declare const svgACH = "M6.5,10H4.5V17H6.5V10M12.5,10H10.5V17H12.5V10M21,19H2V21H21V19M18.5,10H16.5V17H18.5V10M11.5,3.26L16.71,6H6.29L11.5,3.26M11.5,1L2,6V8H21V6L11.5,1Z";
|
|
8
|
+
export declare const svgCheckMark = "M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z";
|
|
9
|
+
export declare const svgInfo = "M12.3 7.29C12.5 7.11 12.74 7 13 7C13.27 7 13.5 7.11 13.71 7.29C13.9 7.5 14 7.74 14 8C14 8.27 13.9 8.5 13.71 8.71C13.5 8.9 13.27 9 13 9C12.74 9 12.5 8.9 12.3 8.71C12.11 8.5 12 8.27 12 8C12 7.74 12.11 7.5 12.3 7.29M9.8 11.97C9.8 11.97 11.97 10.25 12.76 10.18C13.5 10.12 13.35 10.97 13.28 11.41L13.27 11.47C13.13 12 12.96 12.64 12.79 13.25C12.41 14.64 12.04 16 12.13 16.25C12.23 16.59 12.85 16.16 13.3 15.86C13.36 15.82 13.41 15.78 13.46 15.75C13.46 15.75 13.54 15.67 13.62 15.78C13.64 15.81 13.66 15.84 13.68 15.86C13.77 16 13.82 16.05 13.7 16.13L13.66 16.15C13.44 16.3 12.5 16.96 12.12 17.2C11.71 17.47 10.14 18.37 10.38 16.62C10.59 15.39 10.87 14.33 11.09 13.5C11.5 12 11.68 11.32 10.76 11.91C10.39 12.13 10.17 12.27 10.04 12.36C9.93 12.44 9.92 12.44 9.85 12.31L9.82 12.25L9.77 12.17C9.7 12.07 9.7 12.06 9.8 11.97M22 12C22 17.5 17.5 22 12 22C6.5 22 2 17.5 2 12C2 6.5 6.5 2 12 2C17.5 2 22 6.5 22 12M20 12C20 7.58 16.42 4 12 4C7.58 4 4 7.58 4 12C4 16.42 7.58 20 12 20C16.42 20 20 16.42 20 12Z";
|
|
10
|
+
export declare const svgPayPal: {
|
|
11
|
+
path1: string;
|
|
12
|
+
path2: string;
|
|
13
|
+
path3: string;
|
|
14
|
+
path4: string;
|
|
15
|
+
};
|
|
16
|
+
export declare const svgVenmo: {
|
|
17
|
+
path1: string;
|
|
18
|
+
path2: string;
|
|
19
|
+
path3: string;
|
|
20
|
+
path4: string;
|
|
21
|
+
path5: string;
|
|
22
|
+
};
|
|
@@ -0,0 +1,197 @@
|
|
|
1
|
+
import { PaymentMethodType } from '../model';
|
|
2
|
+
export interface AuthviaPaymentMethodFormProps {
|
|
3
|
+
token?: string;
|
|
4
|
+
merchantId?: string;
|
|
5
|
+
card?: {
|
|
6
|
+
allow?: boolean;
|
|
7
|
+
demoMode?: boolean;
|
|
8
|
+
nameOnCard?: string;
|
|
9
|
+
streetAddress?: string;
|
|
10
|
+
city?: string;
|
|
11
|
+
state?: string;
|
|
12
|
+
country?: string;
|
|
13
|
+
postalCode?: string;
|
|
14
|
+
};
|
|
15
|
+
ach?: {
|
|
16
|
+
demoMode?: boolean;
|
|
17
|
+
/** When true, show the "Use your online credentials" (Plaid) option for ACH. */
|
|
18
|
+
online?: boolean;
|
|
19
|
+
nameOnAccount?: string;
|
|
20
|
+
routingNumber?: string;
|
|
21
|
+
accountNumber?: string;
|
|
22
|
+
streetAddress?: string;
|
|
23
|
+
city?: string;
|
|
24
|
+
state?: string;
|
|
25
|
+
country?: string;
|
|
26
|
+
postalCode?: string;
|
|
27
|
+
};
|
|
28
|
+
paypal?: {
|
|
29
|
+
venmo?: boolean;
|
|
30
|
+
merchantId: string;
|
|
31
|
+
clientId: string;
|
|
32
|
+
redirectUrl: string;
|
|
33
|
+
};
|
|
34
|
+
paze?: {
|
|
35
|
+
amount?: string;
|
|
36
|
+
clientId?: string;
|
|
37
|
+
profileId?: string;
|
|
38
|
+
name?: string;
|
|
39
|
+
};
|
|
40
|
+
restrictions?: PaymentMethodRestrictions[];
|
|
41
|
+
intent?: string;
|
|
42
|
+
customerRef?: string;
|
|
43
|
+
variant?: VuetifyProps['variant'];
|
|
44
|
+
color?: string;
|
|
45
|
+
borderRadius?: string;
|
|
46
|
+
forgetHidden?: boolean | string;
|
|
47
|
+
forgetDefault?: boolean | string;
|
|
48
|
+
primaryColor?: string;
|
|
49
|
+
formSubmit?: boolean;
|
|
50
|
+
inputPadding?: string;
|
|
51
|
+
inputSpacing?: string;
|
|
52
|
+
inputNoBorder?: boolean;
|
|
53
|
+
inputBackgroundColor?: string;
|
|
54
|
+
inputTextColor?: string;
|
|
55
|
+
onSubmit?: (data: PaymentMethodFormData) => void;
|
|
56
|
+
onSuccess?: (data: any) => void;
|
|
57
|
+
}
|
|
58
|
+
export interface VuetifyProps {
|
|
59
|
+
theme?: {
|
|
60
|
+
primary?: string;
|
|
61
|
+
secondary?: string;
|
|
62
|
+
accent?: string;
|
|
63
|
+
error?: string;
|
|
64
|
+
warning?: string;
|
|
65
|
+
info?: string;
|
|
66
|
+
success?: string;
|
|
67
|
+
};
|
|
68
|
+
density?: 'default' | 'compact' | 'comfortable';
|
|
69
|
+
variant?: 'outlined' | 'filled' | 'plain' | 'underlined' | 'solo' | 'solo-inverted' | 'solo-filled';
|
|
70
|
+
textVariant?: 'outlined' | 'filled' | 'plain' | 'underlined' | 'solo' | 'solo-inverted' | 'solo-filled';
|
|
71
|
+
spacing?: {
|
|
72
|
+
inputGap?: 'none' | 'xs' | 'sm' | 'md' | 'lg' | 'xl';
|
|
73
|
+
rowGap?: 'none' | 'xs' | 'sm' | 'md' | 'lg' | 'xl';
|
|
74
|
+
sectionGap?: 'none' | 'xs' | 'sm' | 'md' | 'lg' | 'xl';
|
|
75
|
+
buttonGap?: 'none' | 'xs' | 'sm' | 'md' | 'lg' | 'xl';
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
export interface PaymentMethodFormData {
|
|
79
|
+
paymentMethod?: string;
|
|
80
|
+
value?: Record<string, any> | string | number | undefined;
|
|
81
|
+
}
|
|
82
|
+
export interface SubmitEvent {
|
|
83
|
+
azp?: string;
|
|
84
|
+
}
|
|
85
|
+
export interface SuccessEvent {
|
|
86
|
+
azp?: string;
|
|
87
|
+
data: any;
|
|
88
|
+
}
|
|
89
|
+
export interface ErrorEvent {
|
|
90
|
+
azp?: string;
|
|
91
|
+
error: any;
|
|
92
|
+
}
|
|
93
|
+
export declare class AVError extends Error {
|
|
94
|
+
code: string;
|
|
95
|
+
details?: any[] | undefined;
|
|
96
|
+
constructor(code: string, message: string, details?: any[] | undefined);
|
|
97
|
+
}
|
|
98
|
+
export interface PaymentMethodResponse {
|
|
99
|
+
success: boolean;
|
|
100
|
+
data?: any;
|
|
101
|
+
error?: string;
|
|
102
|
+
message: string;
|
|
103
|
+
}
|
|
104
|
+
export interface ValidationError {
|
|
105
|
+
field: string;
|
|
106
|
+
message: string;
|
|
107
|
+
code: string;
|
|
108
|
+
}
|
|
109
|
+
export interface PaymentMethodService {
|
|
110
|
+
getPaymentMethodFromUnion(union: string): Promise<PaymentMethodResponse>;
|
|
111
|
+
}
|
|
112
|
+
export interface TokenValidationResponse {
|
|
113
|
+
success: boolean;
|
|
114
|
+
data?: {
|
|
115
|
+
valid: boolean;
|
|
116
|
+
expiresAt?: string;
|
|
117
|
+
scopes?: string[];
|
|
118
|
+
clientId?: string;
|
|
119
|
+
userId?: string;
|
|
120
|
+
};
|
|
121
|
+
error?: string;
|
|
122
|
+
message: string;
|
|
123
|
+
}
|
|
124
|
+
export interface TokenValidationConfig {
|
|
125
|
+
validateOnMount?: boolean;
|
|
126
|
+
autoRefresh?: boolean;
|
|
127
|
+
refreshThreshold?: number;
|
|
128
|
+
retryAttempts?: number;
|
|
129
|
+
retryDelay?: number;
|
|
130
|
+
}
|
|
131
|
+
export type PaymentOptions = Record<string, {
|
|
132
|
+
name: string;
|
|
133
|
+
active: boolean;
|
|
134
|
+
demo: boolean;
|
|
135
|
+
}>;
|
|
136
|
+
export type P_ProductLine = {
|
|
137
|
+
id?: string;
|
|
138
|
+
line: 'payments' | 'messaging' | string;
|
|
139
|
+
product: string;
|
|
140
|
+
demo?: boolean;
|
|
141
|
+
provider?: string;
|
|
142
|
+
};
|
|
143
|
+
export interface PaymentMethodRestrictions {
|
|
144
|
+
type: string[];
|
|
145
|
+
binType?: string[];
|
|
146
|
+
cardCategory?: string[];
|
|
147
|
+
brand?: string[];
|
|
148
|
+
bin?: string[];
|
|
149
|
+
accountType?: string[];
|
|
150
|
+
}
|
|
151
|
+
export interface PaymentMethodCustom {
|
|
152
|
+
originatingId?: string;
|
|
153
|
+
type: PaymentMethodType;
|
|
154
|
+
traits?: {
|
|
155
|
+
provider: string;
|
|
156
|
+
merchantId: string;
|
|
157
|
+
customerRef?: string;
|
|
158
|
+
ccType?: string;
|
|
159
|
+
bin?: string;
|
|
160
|
+
issuer?: {
|
|
161
|
+
country?: string;
|
|
162
|
+
};
|
|
163
|
+
};
|
|
164
|
+
subType?: string;
|
|
165
|
+
cardCategory?: string;
|
|
166
|
+
brand?: string;
|
|
167
|
+
ccType?: string;
|
|
168
|
+
bin?: string;
|
|
169
|
+
accountType?: string;
|
|
170
|
+
issuer?: {
|
|
171
|
+
country?: string;
|
|
172
|
+
};
|
|
173
|
+
}
|
|
174
|
+
export interface PaymentMethodLogo {
|
|
175
|
+
src?: string;
|
|
176
|
+
path?: string;
|
|
177
|
+
}
|
|
178
|
+
export interface PaymentMethodDisplayConfig {
|
|
179
|
+
title: string;
|
|
180
|
+
description: string;
|
|
181
|
+
logo?: {
|
|
182
|
+
src?: string;
|
|
183
|
+
path?: string;
|
|
184
|
+
};
|
|
185
|
+
}
|
|
186
|
+
/** Config item passed to AuthviaPaymentMethodCard (includes type and onClick context) */
|
|
187
|
+
export interface PaymentMethodConfigItem {
|
|
188
|
+
type: string;
|
|
189
|
+
disabled: boolean;
|
|
190
|
+
title: string;
|
|
191
|
+
description: string;
|
|
192
|
+
logo?: {
|
|
193
|
+
src?: string;
|
|
194
|
+
path?: string;
|
|
195
|
+
};
|
|
196
|
+
error?: string;
|
|
197
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Resolve the base API URL from a given hostname or the browser's current hostname.
|
|
3
|
+
* Falls back to nonprod by default.
|
|
4
|
+
*/
|
|
5
|
+
export declare function resolveApiBaseUrl(hostname?: string): string;
|
|
6
|
+
export declare const API_BASE_URL: string;
|
|
7
|
+
export default API_BASE_URL;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
export declare const config: {
|
|
2
|
+
apiBaseUrl: string;
|
|
3
|
+
apiVersion: string;
|
|
4
|
+
enableLogging: boolean;
|
|
5
|
+
enableDebug: boolean;
|
|
6
|
+
cdnUrl: string;
|
|
7
|
+
enableAnalytics: boolean;
|
|
8
|
+
enableErrorReporting: boolean;
|
|
9
|
+
enablePerformanceMonitoring: boolean;
|
|
10
|
+
enableCSP: boolean;
|
|
11
|
+
enableHSTS: boolean;
|
|
12
|
+
buildTarget: string;
|
|
13
|
+
sourceMaps: boolean;
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* Get API endpoint URL
|
|
17
|
+
*/
|
|
18
|
+
export declare function getApiEndpoint(path: string): string;
|
|
19
|
+
/**
|
|
20
|
+
* Get CDN URL for assets
|
|
21
|
+
*/
|
|
22
|
+
export declare function getCdnUrl(path: string): string;
|
|
23
|
+
/**
|
|
24
|
+
* Check if running in development mode
|
|
25
|
+
*/
|
|
26
|
+
export declare function isDevelopment(): boolean;
|
|
27
|
+
/**
|
|
28
|
+
* Check if running in production mode
|
|
29
|
+
*/
|
|
30
|
+
export declare function isProduction(): boolean;
|
|
31
|
+
/**
|
|
32
|
+
* Get environment-specific configuration
|
|
33
|
+
*/
|
|
34
|
+
export declare function getEnvironmentConfig(): {
|
|
35
|
+
isDev: boolean;
|
|
36
|
+
isProd: boolean;
|
|
37
|
+
apiBaseUrl: string;
|
|
38
|
+
enableLogging: boolean;
|
|
39
|
+
enableDebug: boolean;
|
|
40
|
+
};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { AVError } from '../types';
|
|
2
|
+
export declare class ErrorHandler {
|
|
3
|
+
/**
|
|
4
|
+
* Handle and format errors consistently
|
|
5
|
+
*/
|
|
6
|
+
static handleError(error: any): string;
|
|
7
|
+
/**
|
|
8
|
+
* Create a user-friendly error message
|
|
9
|
+
*/
|
|
10
|
+
static createUserFriendlyMessage(error: any): string;
|
|
11
|
+
/**
|
|
12
|
+
* Log error for debugging
|
|
13
|
+
*/
|
|
14
|
+
static logError(error: any): void;
|
|
15
|
+
/**
|
|
16
|
+
* Create a custom error with code
|
|
17
|
+
*/
|
|
18
|
+
static createError(code: string, message: string, details?: any[]): AVError;
|
|
19
|
+
/**
|
|
20
|
+
* Validate if an error is recoverable
|
|
21
|
+
*/
|
|
22
|
+
static isRecoverableError(error: any): boolean;
|
|
23
|
+
}
|
|
24
|
+
export declare const ErrorCodes: {
|
|
25
|
+
readonly VALIDATION_ERROR: "VALIDATION_ERROR";
|
|
26
|
+
readonly NETWORK_ERROR: "NETWORK_ERROR";
|
|
27
|
+
readonly AUTH_FAILED: "AUTH_FAILED";
|
|
28
|
+
readonly INVALID_TOKEN: "INVALID_TOKEN";
|
|
29
|
+
readonly PERMISSION_DENIED: "PERMISSION_DENIED";
|
|
30
|
+
readonly NOT_FOUND: "NOT_FOUND";
|
|
31
|
+
readonly SERVER_ERROR: "SERVER_ERROR";
|
|
32
|
+
};
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { PaymentMethodRestrictions } from '../types';
|
|
2
|
+
export declare const isMobile: () => boolean;
|
|
3
|
+
/**
|
|
4
|
+
* @param str Input string
|
|
5
|
+
* @param limit Charcter limit
|
|
6
|
+
* @returns truncated string
|
|
7
|
+
*/
|
|
8
|
+
export declare const truncateString: (str: string, limit: number) => string;
|
|
9
|
+
/**
|
|
10
|
+
* Method to show truncated name based on device (Mobile or Desktop) if char limit cross
|
|
11
|
+
* @param name Name of cardholder
|
|
12
|
+
* @returns cardholder truncated name
|
|
13
|
+
*/
|
|
14
|
+
export declare const cardHolderName: (name: string) => string;
|
|
15
|
+
export declare const getBrandImg: (brand: string) => string;
|
|
16
|
+
export declare const getPaymentMethodIcon: (method: any) => string;
|
|
17
|
+
export declare function hasPaymentMethodsReadScope(token: string | undefined): boolean;
|
|
18
|
+
/**
|
|
19
|
+
* Resolves a theme color for legacy callers. Prefer setting `color` / `fill` via CSS (`--avwc-color`) instead.
|
|
20
|
+
*/
|
|
21
|
+
export declare const merchantThemeColor: () => any;
|
|
22
|
+
export declare const transformPaymentMethodType: (type: string) => string;
|
|
23
|
+
export declare const generateRestrictionStatementsFromArray: (restrictions: PaymentMethodRestrictions[]) => string[];
|
|
24
|
+
export declare const checkRestrictions: (restrictionValues: string[] | undefined, paymentMethodValue: string | undefined) => boolean;
|
|
25
|
+
export declare const checkBinRestrictions: (binRestrictions: string[] | undefined, paymentMethodBin: string | undefined) => boolean;
|
|
26
|
+
/**
|
|
27
|
+
* Extracts the user ID and token from an auth token.
|
|
28
|
+
* @param authToken - The authentication token string.
|
|
29
|
+
* @returns An object containing the user ID and the original auth token.
|
|
30
|
+
* @throws Error if the auth token is missing or invalid.
|
|
31
|
+
*/
|
|
32
|
+
export declare const getUserAndToken: (authToken: string | undefined) => {
|
|
33
|
+
user: any;
|
|
34
|
+
token: string;
|
|
35
|
+
azp: any;
|
|
36
|
+
};
|
|
37
|
+
export declare const inputACHErrorMessages: Record<string, string>;
|
|
38
|
+
/**
|
|
39
|
+
* Capitalizes the first letter of each word in a string
|
|
40
|
+
* @param str - The string to capitalize
|
|
41
|
+
* @returns The capitalized string
|
|
42
|
+
*/
|
|
43
|
+
export declare const capitalizeTitle: (str: string | undefined) => string;
|
|
44
|
+
export declare const usPhoneNumberRegex: RegExp;
|
|
45
|
+
export declare const phoneNumberPattern: RegExp;
|
|
46
|
+
/**
|
|
47
|
+
* Checks if an email address is valid.
|
|
48
|
+
* @param email - The email address to check.
|
|
49
|
+
* @returns True if the email address is valid, false otherwise.
|
|
50
|
+
*/
|
|
51
|
+
export declare const isValidEmailAddress: (email: string) => boolean;
|
|
52
|
+
export declare const mobileNumberFormat: (mobileNumber: string) => string;
|
|
53
|
+
/**
|
|
54
|
+
* Checks if an handle is valid.
|
|
55
|
+
* @param handle - The handle to check.
|
|
56
|
+
* @returns True if the handle is valid, false otherwise.
|
|
57
|
+
*/
|
|
58
|
+
export declare const isValidHandle: (handle: string) => boolean;
|
|
59
|
+
export declare const anyAlpha: RegExp;
|
|
60
|
+
export declare function addressFormat(address: string): string;
|
|
61
|
+
/**
|
|
62
|
+
* Handles payment method creation errors, specifically checking for 409 status (duplicate payment method)
|
|
63
|
+
* @param error - The error object from the API call
|
|
64
|
+
* @param emit - The emit function from the Vue component
|
|
65
|
+
* @param clearFormData - Function to clear form data
|
|
66
|
+
* @param forgetCard - Optional forgetCard value to include in success payload (defaults to false)
|
|
67
|
+
* @returns boolean - true if 409 error was handled, false otherwise
|
|
68
|
+
*/
|
|
69
|
+
export declare function handlePaymentMethodError(error: any, emit: (..._args: any[]) => void, clearFormData: () => void, forgetCard?: boolean): boolean;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
export interface SpacingConfig {
|
|
2
|
+
inputGap?: 'none' | 'xs' | 'sm' | 'md' | 'lg' | 'xl';
|
|
3
|
+
rowGap?: 'none' | 'xs' | 'sm' | 'md' | 'lg' | 'xl';
|
|
4
|
+
sectionGap?: 'none' | 'xs' | 'sm' | 'md' | 'lg' | 'xl';
|
|
5
|
+
buttonGap?: 'none' | 'xs' | 'sm' | 'md' | 'lg' | 'xl';
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* Get spacing classes based on configuration
|
|
9
|
+
*/
|
|
10
|
+
export declare function getInputSpacingClasses(spacing?: SpacingConfig): {
|
|
11
|
+
sectionClass: string;
|
|
12
|
+
cardStyle: {
|
|
13
|
+
marginBottom: string;
|
|
14
|
+
};
|
|
15
|
+
cardTextClass: string;
|
|
16
|
+
cardTextStyle: {
|
|
17
|
+
padding: string;
|
|
18
|
+
};
|
|
19
|
+
rowClass: string;
|
|
20
|
+
rowStyle: {
|
|
21
|
+
marginBottom: string;
|
|
22
|
+
};
|
|
23
|
+
colClass: string;
|
|
24
|
+
colStyle: {
|
|
25
|
+
padding: string;
|
|
26
|
+
};
|
|
27
|
+
inputClass: string;
|
|
28
|
+
inputStyle: {
|
|
29
|
+
marginBottom: string;
|
|
30
|
+
};
|
|
31
|
+
buttonClass: string;
|
|
32
|
+
buttonStyle: {
|
|
33
|
+
marginTop: string;
|
|
34
|
+
};
|
|
35
|
+
};
|
|
36
|
+
/**
|
|
37
|
+
* Get CSS custom properties for spacing
|
|
38
|
+
*/
|
|
39
|
+
export declare function getSpacingCSSVariables(spacing?: SpacingConfig): Record<string, string>;
|