@authvia/payment-method-create 0.1.1 → 0.2.1

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.
@@ -15,19 +15,15 @@ declare const _default: import('vue').DefineComponent<Props, {
15
15
  onReady?: (() => any) | undefined;
16
16
  "onPayment-method-created"?: ((paymentMethodId: string) => any) | undefined;
17
17
  }>, {
18
- variant: "outlined" | "filled" | "plain" | "underlined" | "solo" | "solo-inverted" | "solo-filled";
18
+ variant: "outlined" | "plain" | "underlined" | "filled" | "solo" | "solo-filled" | "solo-inverted";
19
+ merchantId: string;
19
20
  paze: {
20
21
  amount?: string;
21
22
  clientId?: string;
22
23
  profileId?: string;
23
24
  name?: string;
24
25
  };
25
- paypal: {
26
- venmo?: boolean;
27
- merchantId: string;
28
- clientId: string;
29
- redirectUrl: string;
30
- };
26
+ paypal: boolean | import('../types').PayPalConfig;
31
27
  ach: {
32
28
  demoMode?: boolean;
33
29
  online?: boolean;
@@ -43,14 +39,15 @@ declare const _default: import('vue').DefineComponent<Props, {
43
39
  country?: string;
44
40
  postalCode?: string;
45
41
  };
42
+ venmo: boolean;
46
43
  color: string;
47
44
  forgetDefault: boolean | string;
48
45
  customerRef: string;
49
46
  token: string;
50
47
  borderRadius: string;
51
- merchantId: string;
52
48
  forgetHidden: boolean | string;
53
49
  intent: string;
50
+ vuetifyOverrides: string;
54
51
  restrictions: PaymentMethodRestrictions[];
55
52
  card: {
56
53
  allow?: boolean;
@@ -14,7 +14,6 @@ export interface P_ACHValues {
14
14
  }
15
15
  type AchFieldKey = 'routingNumber' | 'accountNumber' | 'nameOnAccount';
16
16
  type ValidationRule = (value: unknown) => true | string;
17
- type VuetifyFieldVariant = 'outlined' | 'plain' | 'underlined' | 'filled' | 'solo' | 'solo-filled' | 'solo-inverted';
18
17
  export interface Props {
19
18
  demoMode?: boolean;
20
19
  submitBtnText?: string;
@@ -94,8 +93,8 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
94
93
  savings: string;
95
94
  checking: string;
96
95
  };
97
- fieldVariant: ComputedRef<VuetifyFieldVariant>;
98
- fieldVariantSafe: ComputedRef<VuetifyFieldVariant>;
96
+ fieldVariant: ComputedRef<"outlined" | "plain" | "underlined" | "filled" | "solo" | "solo-filled" | "solo-inverted">;
97
+ fieldVariantSafe: ComputedRef<"outlined" | "plain" | "underlined" | "filled" | "solo" | "solo-filled" | "solo-inverted">;
99
98
  formData: P_ACHValues;
100
99
  isWorking: Ref<boolean, boolean>;
101
100
  isFormValid: ComputedRef<boolean>;
@@ -0,0 +1,48 @@
1
+ import { PaymentMethodType } from '../../model';
2
+ import { TermsConfig, Variant } from '../../types';
3
+ type FormType = 'paypal' | 'venmo';
4
+ type PayoutTraits = {
5
+ email?: string;
6
+ phone?: string;
7
+ handle?: string;
8
+ };
9
+ type __VLS_Props = {
10
+ authToken: string;
11
+ merchantId?: string;
12
+ customerRef?: string;
13
+ intent?: string;
14
+ type?: FormType;
15
+ terms?: TermsConfig;
16
+ forgetHidden?: boolean;
17
+ forgetDefault?: boolean;
18
+ variant?: Variant | string;
19
+ };
20
+ declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
21
+ error: (payload: {
22
+ message: string;
23
+ }) => any;
24
+ success: (payload: Record<string, unknown>) => any;
25
+ submit: (payload: {
26
+ type: PaymentMethodType;
27
+ traits: PayoutTraits;
28
+ }) => any;
29
+ }, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{
30
+ onError?: ((payload: {
31
+ message: string;
32
+ }) => any) | undefined;
33
+ onSuccess?: ((payload: Record<string, unknown>) => any) | undefined;
34
+ onSubmit?: ((payload: {
35
+ type: PaymentMethodType;
36
+ traits: PayoutTraits;
37
+ }) => any) | undefined;
38
+ }>, {
39
+ type: FormType;
40
+ variant: Variant | string;
41
+ merchantId: string;
42
+ forgetDefault: boolean;
43
+ terms: TermsConfig;
44
+ customerRef: string;
45
+ forgetHidden: boolean;
46
+ intent: string;
47
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLDivElement>;
48
+ export default _default;
@@ -1,5 +1,6 @@
1
1
  import { ComputedRef, PropType, Ref } from 'vue';
2
2
  import { PaymentMethodBillingAddress } from '../../model';
3
+ import { TermsConfig } from '../../types';
3
4
  type CreditCardPrefill = {
4
5
  cardNumber?: string;
5
6
  nameOnCard?: string;
@@ -73,6 +74,14 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
73
74
  required: false;
74
75
  default: any;
75
76
  };
77
+ terms: {
78
+ type: PropType<TermsConfig>;
79
+ required: false;
80
+ };
81
+ vuetifyOverrides: {
82
+ type: StringConstructor;
83
+ required: false;
84
+ };
76
85
  }>, {
77
86
  squelch: boolean;
78
87
  token: string;
@@ -97,11 +106,11 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
97
106
  nameOnCard: ComputedRef<string>;
98
107
  expiration: ComputedRef<string>;
99
108
  cvv: ComputedRef<string>;
109
+ termsContent: ComputedRef<string | undefined>;
100
110
  variant: string;
101
111
  submitLabel: any;
102
112
  handleSuccess: (event: unknown) => void;
103
113
  handleError: (error: unknown) => void;
104
- apiBaseUrl: string;
105
114
  }, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, ("error" | "success")[], "error" | "success", import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
106
115
  demoMode: {
107
116
  type: BooleanConstructor;
@@ -169,6 +178,14 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
169
178
  required: false;
170
179
  default: any;
171
180
  };
181
+ terms: {
182
+ type: PropType<TermsConfig>;
183
+ required: false;
184
+ };
185
+ vuetifyOverrides: {
186
+ type: StringConstructor;
187
+ required: false;
188
+ };
172
189
  }>> & Readonly<{
173
190
  onError?: ((...args: any[]) => any) | undefined;
174
191
  onSuccess?: ((...args: any[]) => any) | undefined;
@@ -51,13 +51,6 @@ declare class AuthviaPaymentMethodFormElement extends HTMLElement {
51
51
  private injectVuetifyOverrideStyles;
52
52
  private getVuetifyOverrideCss;
53
53
  private injectComponentStyles;
54
- /**
55
- * Injects ACH/dialog styles so inputs and buttons in dialogs get variable-based
56
- * styling. Always run (with and without bundle CSS) so dialog overlay content
57
- * is styled; appended last so it overrides. Scoped to .v-overlay__content for
58
- * higher specificity so it wins over bundle CSS for overlay content.
59
- */
60
- private injectDevFallbackDialogStyles;
61
54
  private injectDevVariablesStyles;
62
55
  private ensureStylesheetDependency;
63
56
  private findParentStylesheet;
@@ -20,6 +20,19 @@ export interface TermsConfig {
20
20
  privacyPolicy?: TermsLinkConfig;
21
21
  termsOfService?: TermsLinkConfig;
22
22
  }
23
+ /**
24
+ * Object shape when the `paypal` prop is a config object (not boolean `true`).
25
+ */
26
+ export type PayPalConfig = {
27
+ merchantId: string;
28
+ clientId: string;
29
+ redirectUrl?: string;
30
+ };
31
+ /** Allowed values for Vuetify 3 `v-text-field` / field `variant` (shared across payment method components). */
32
+ export declare const VUETIFY_FIELD_VARIANTS: readonly ["outlined", "plain", "underlined", "filled", "solo", "solo-filled", "solo-inverted"];
33
+ export type VuetifyFieldVariant = (typeof VUETIFY_FIELD_VARIANTS)[number];
34
+ /** Alias for {@link VuetifyFieldVariant}. */
35
+ export type Variant = VuetifyFieldVariant;
23
36
  export interface AuthviaPaymentMethodFormProps {
24
37
  token?: string;
25
38
  merchantId?: string;
@@ -55,12 +68,8 @@ export interface AuthviaPaymentMethodFormProps {
55
68
  country?: string;
56
69
  postalCode?: string;
57
70
  };
58
- paypal?: {
59
- venmo?: boolean;
60
- merchantId: string;
61
- clientId: string;
62
- redirectUrl: string;
63
- };
71
+ paypal?: boolean | PayPalConfig;
72
+ venmo?: boolean;
64
73
  paze?: {
65
74
  amount?: string;
66
75
  clientId?: string;
@@ -73,6 +82,8 @@ export interface AuthviaPaymentMethodFormProps {
73
82
  variant?: VuetifyProps['variant'];
74
83
  color?: string;
75
84
  borderRadius?: string;
85
+ /** CSS for nested credit-card WC (`data-vuetify-overrides`); outer WC host uses the same attr for shadow injection. */
86
+ vuetifyOverrides?: string;
76
87
  paymentMethodDisplay?: PaymentMethodDisplayConfigMap;
77
88
  terms?: TermsConfig;
78
89
  forgetHidden?: boolean | string;
@@ -98,8 +109,8 @@ export interface VuetifyProps {
98
109
  success?: string;
99
110
  };
100
111
  density?: 'default' | 'compact' | 'comfortable';
101
- variant?: 'outlined' | 'filled' | 'plain' | 'underlined' | 'solo' | 'solo-inverted' | 'solo-filled';
102
- textVariant?: 'outlined' | 'filled' | 'plain' | 'underlined' | 'solo' | 'solo-inverted' | 'solo-filled';
112
+ variant?: VuetifyFieldVariant;
113
+ textVariant?: VuetifyFieldVariant;
103
114
  spacing?: {
104
115
  inputGap?: 'none' | 'xs' | 'sm' | 'md' | 'lg' | 'xl';
105
116
  rowGap?: 'none' | 'xs' | 'sm' | 'md' | 'lg' | 'xl';
@@ -16,6 +16,19 @@ export declare const config: {
16
16
  * Get API endpoint URL
17
17
  */
18
18
  export declare function getApiEndpoint(path: string): string;
19
+ /**
20
+ * Default path (relative to {@link config.cdnUrl}) for the credit-card loader script.
21
+ * Matches the legacy hardcoded `/js/authvia-credit-card.js` used before env-based layout overrides.
22
+ */
23
+ export declare const DEFAULT_CREDIT_CARD_SCRIPT_PATH: string;
24
+ /**
25
+ * Resolves the `src` for the authvia-credit-card loader script via {@link getCdnUrl}.
26
+ * `VITE_APP_CDN_URL` must be a CDN base (no trailing slash required); the script path defaults to
27
+ * {@link DEFAULT_CREDIT_CARD_SCRIPT_PATH} or `VITE_APP_CREDIT_CARD_SCRIPT_PATH` when the file lives elsewhere on the CDN.
28
+ *
29
+ * @returns A non-empty string suitable for a script element `src`
30
+ */
31
+ export declare function getCreditCardScriptSrc(): string;
19
32
  /**
20
33
  * Get CDN URL for assets
21
34
  */
@@ -0,0 +1,25 @@
1
+ /**
2
+ * Validate payout email input (delegates to shared {@link isValidEmailAddress} on trimmed value).
3
+ */
4
+ export declare const isValidEmail: (value: string) => boolean;
5
+ /**
6
+ * Validate payout phone input with common US formats (uses shared phone patterns from utils).
7
+ */
8
+ export declare const isValidPhone: (value: string) => boolean;
9
+ /**
10
+ * Validate payout handle input (strips leading @ then uses shared {@link isValidHandle}).
11
+ */
12
+ export declare const isValidPayoutHandle: (value: string) => boolean;
13
+ /**
14
+ * Strip separators and normalize to 10-digit US number when possible.
15
+ */
16
+ export declare const normalizeUsPhone: (value: string) => string;
17
+ /**
18
+ * Format as (XXX) XXX-XXXX when possible (delegates to shared {@link mobileNumberFormat}).
19
+ */
20
+ export declare const formatPhone: (value: string) => string;
21
+ /**
22
+ * Formats US phone while typing, e.g. (981) 828-7032.
23
+ * Keeps partial state as digits are entered (used by tests; progressive UX if wired later).
24
+ */
25
+ export declare const formatPhoneTyping: (value: string) => string;
@@ -0,0 +1,5 @@
1
+ import { PayPalConfig } from '../types';
2
+ /**
3
+ * Type guard: value is a PayPal module config object (`merchantId` + `clientId`, optional `redirectUrl`).
4
+ */
5
+ export declare function isPayPalConfig(value: unknown): value is PayPalConfig;