@authvia/payment-method-create 0.6.0 → 0.6.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.
package/README.md CHANGED
@@ -165,7 +165,7 @@ Details and examples match **Storybook** (`src/components/AuthviaPaymentMethodFo
165
165
  | Methods | `card`, `ach`, `paypal`, `venmo`, `paze` |
166
166
  | List UI | `paymentMethodDisplay` (titles, subtitles, order; optional root `gap`) |
167
167
  | Legal / footer | `terms` (privacy + terms links) |
168
- | Behavior | `forgetHidden`, `forgetDefault`, `restrictions` |
168
+ | Behavior | `forgetHidden`, `forgetDefault` |
169
169
  | Styling | `color` (default `#4CAF50`, from `DEFAULT_AVWC_PRIMARY_COLOR`), `borderRadius` (default `1rem`, from `DEFAULT_AVWC_BORDER_RADIUS`), `variant` (default `outlined`, from `DEFAULT_AVWC_FIELD_VARIANT`), `vuetifyOverrides` (web component: plain CSS string for Shadow DOM) |
170
170
 
171
171
  ### `paymentMethodDisplay`
@@ -195,12 +195,12 @@ data-payment-method-display='{"gap":"1rem","card":{"title":"Card","order":1},"ac
195
195
 
196
196
  ### Paze (`paze`)
197
197
 
198
- Requires `amount`, `clientId`, `profileId`, and `name` on the object you pass; **all must be non-empty** (after trim). If any are missing or blank, **Paze is not shown** in the picker (including when `restrictions` list Paze but the `paze` prop is incomplete). The inner flow runs in two steps: **Initializing Paze** (SDK load) then **Processing Paze payment** (checkout → complete → create). Failures emit `error` and return the user to the payment method list without an inline error banner on that step; details are logged for developers.
198
+ Requires `amount`, `clientId`, `profileId`, and `name` on the object you pass; **all must be non-empty** (after trim). If any are missing or blank, **Paze is not shown** in the picker. The inner flow runs in two steps: **Initializing Paze** (SDK load) then **Processing Paze payment** (checkout → complete → create). Failures emit `error` and return the user to the payment method list without an inline error banner on that step; details are logged for developers.
199
199
 
200
200
  ### PayPal / Venmo
201
201
 
202
202
  - **`intent="payouts"`:** `paypal` and `venmo` can be booleans; PayPal and Venmo **stay listed** even when `merchantId` is incomplete (same as before for payouts).
203
- - **`intent="payments"`** (and any intent other than `payouts`): PayPal and Venmo appear in the picker only when **`merchantId`** is non-empty on the resolved wallet settings **and** the build defines **`VITE_APP_PAYPAL_CLIENT_ID`**. Otherwise those rows are **hidden** (same rules as the former click-time `error`, without showing a dead option). Use `restrictions` only when you intend to allow those methods; incomplete wallet config still strips PayPal/Venmo from the list.
203
+ - **`intent="payments"`** (and any intent other than `payouts`): PayPal and Venmo appear in the picker only when **`merchantId`** is non-empty on the resolved wallet settings **and** the build defines **`VITE_APP_PAYPAL_CLIENT_ID`**. Otherwise those rows are **hidden** (same rules as the former click-time `error`, without showing a dead option).
204
204
  - Pass **`merchantId`** and optional **`redirectUrl`** on the `paypal` / `venmo` object when you want the payments flow to succeed.
205
205
 
206
206
  ## Stable styling hook classes (overrides)
@@ -62,7 +62,6 @@ declare const _default: import('vue').DefineComponent<Props, {
62
62
  intent: string;
63
63
  borderRadius: string;
64
64
  vuetifyOverrides: string;
65
- restrictions: import('../types').PaymentMethodRestrictions[];
66
65
  }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
67
66
  rootRef: HTMLDivElement;
68
67
  }, HTMLDivElement>;
@@ -36,7 +36,7 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
36
36
  "onClose-ach-options"?: ((...args: any[]) => any) | undefined;
37
37
  "onAch-option-select"?: ((...args: any[]) => any) | undefined;
38
38
  }>, {
39
- showConfirmLoader: boolean;
40
39
  isPlaidVisible: boolean;
40
+ showConfirmLoader: boolean;
41
41
  }, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
42
42
  export default _default;
@@ -1,6 +1,6 @@
1
1
  import { PropType } from 'vue';
2
2
  import { PaymentMethodBillingAddress } from '../../model';
3
- import { PaymentMethodDisplayConfigMap, PaymentMethodRestrictions, TermsConfig } from '../../types';
3
+ import { PaymentMethodDisplayConfigMap, TermsConfig } from '../../types';
4
4
  export type { PaymentMethodOptionsProps } from '../../types/paymentMethodOptions';
5
5
  declare const _default: import('vue').DefineComponent<import('vue').ExtractPropTypes<{
6
6
  token: {
@@ -106,11 +106,6 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
106
106
  type: StringConstructor;
107
107
  required: false;
108
108
  };
109
- restrictions: {
110
- type: PropType<PaymentMethodRestrictions[]>;
111
- required: false;
112
- default: () => never[];
113
- };
114
109
  vuetifyOverrides: {
115
110
  type: StringConstructor;
116
111
  required: false;
@@ -155,7 +150,6 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
155
150
  handlePlaidInitialize: () => void;
156
151
  handlePlaidExit: () => void;
157
152
  handlePlaidError: () => void;
158
- restrictionStatements: import('vue').ComputedRef<string[]>;
159
153
  paypalDescription: import('vue').ComputedRef<string>;
160
154
  paypalFormHeading: import('vue').ComputedRef<string>;
161
155
  venmoFormHeading: import('vue').ComputedRef<string>;
@@ -294,11 +288,6 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
294
288
  type: StringConstructor;
295
289
  required: false;
296
290
  };
297
- restrictions: {
298
- type: PropType<PaymentMethodRestrictions[]>;
299
- required: false;
300
- default: () => never[];
301
- };
302
291
  vuetifyOverrides: {
303
292
  type: StringConstructor;
304
293
  required: false;
@@ -319,7 +308,6 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
319
308
  cardDemoMode: boolean;
320
309
  allowedPaymentMethodTypes: string[];
321
310
  achOnline: boolean;
322
- restrictions: PaymentMethodRestrictions[];
323
311
  }, {}, {
324
312
  AuthviaPazeForm: import('vue').DefineComponent<{
325
313
  pzSettings?: {
@@ -461,7 +449,6 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
461
449
  show: boolean;
462
450
  optionsCardClass: string;
463
451
  optionsListClass: string;
464
- restrictionStatements: string[] | undefined;
465
452
  paymentMethodConfigs: import('../../types').PaymentMethodConfigItem[] | undefined;
466
453
  paymentMethodOptionsContainerStyle: Record<string, string>;
467
454
  }, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
@@ -470,7 +457,6 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
470
457
  show: boolean;
471
458
  optionsCardClass: string;
472
459
  optionsListClass: string;
473
- restrictionStatements: string[] | undefined;
474
460
  paymentMethodConfigs: import('../../types').PaymentMethodConfigItem[] | undefined;
475
461
  paymentMethodOptionsContainerStyle: Record<string, string>;
476
462
  }> & Readonly<{
@@ -3,7 +3,6 @@ type PickerCardProps = {
3
3
  show: boolean;
4
4
  optionsCardClass: string;
5
5
  optionsListClass: string;
6
- restrictionStatements: string[] | undefined;
7
6
  paymentMethodConfigs: PaymentMethodConfigItem[] | undefined;
8
7
  paymentMethodOptionsContainerStyle: Record<string, string>;
9
8
  };
@@ -45,7 +45,6 @@ export declare function useAuthviaPaymentMethodOptions(props: PaymentMethodOptio
45
45
  handlePlaidInitialize: () => void;
46
46
  handlePlaidExit: () => void;
47
47
  handlePlaidError: () => void;
48
- restrictionStatements: import('vue').ComputedRef<string[]>;
49
48
  paypalDescription: import('vue').ComputedRef<string>;
50
49
  paypalFormHeading: import('vue').ComputedRef<string>;
51
50
  venmoFormHeading: import('vue').ComputedRef<string>;
@@ -5,7 +5,6 @@ import { PaymentMethodOptionsProps } from '../../types/paymentMethodOptions';
5
5
  * Restriction text, per-method config for the chooser, and PayPal/Venmo heading strings.
6
6
  */
7
7
  export declare function usePaymentMethodOptionsDisplay(props: PaymentMethodOptionsProps): {
8
- restrictionStatements: ComputedRef<string[]>;
9
8
  paypalDescription: ComputedRef<string>;
10
9
  paypalFormHeading: ComputedRef<string>;
11
10
  venmoFormHeading: ComputedRef<string>;
@@ -1,3 +1,4 @@
1
+ export type HostRuntimeConfigKey = 'googleAPIKey' | 'pazeSDKURL' | 'paypalSDKURL' | 'paypalClientId' | 'paypalEnvironment' | 'plaidEnv';
1
2
  /**
2
3
  * Return type for useHostService composable
3
4
  * Compatible with original HostService.instance() API
@@ -1,12 +1,14 @@
1
1
  import { App } from 'vue';
2
2
  import { default as AuthviaPaymentMethodForm } from '../components/AuthviaPaymentMethodForm.vue';
3
- declare const AuthviaPaymentMethodFormPlugin: {
4
- install: (app: App) => void;
3
+ import { AuthviaPaymentMethodFormPluginOptions } from '../types';
4
+ declare const AuthviaPaymentMethodCreatePlugin: {
5
+ install: (app: App, options?: AuthviaPaymentMethodFormPluginOptions) => void;
5
6
  };
6
- export default AuthviaPaymentMethodFormPlugin;
7
- export { AuthviaPaymentMethodFormPlugin };
7
+ export default AuthviaPaymentMethodCreatePlugin;
8
+ export { AuthviaPaymentMethodCreatePlugin };
9
+ export type { AuthviaPaymentMethodFormPluginOptions };
8
10
  export { AuthviaPaymentMethodForm };
9
- export type { AuthviaPaymentMethodFormProps, PaymentMethodFormData, VuetifyProps, SubmitEvent, SuccessEvent, ErrorEvent, PaymentMethodResponse, ValidationError, AVError } from '../types';
11
+ export type { AuthviaPaymentMethodFormProps, PaymentMethodFormData, VuetifyProps, SubmitEvent, SuccessEvent, ErrorEvent, PaymentMethodResponse, ValidationError, AVError, } from '../types';
10
12
  export { ErrorHandler, ErrorCodes } from '../utils/errors';
11
13
  export { config, getApiEndpoint, getCdnUrl, isDevelopment, isProduction } from '../utils/config';
12
14
  export { getInputSpacingClasses, getSpacingCSSVariables } from '../utils/spacing';
@@ -106,7 +106,6 @@ export interface AuthviaPaymentMethodFormProps {
106
106
  profileId?: string;
107
107
  name?: string;
108
108
  };
109
- restrictions?: PaymentMethodRestrictions[];
110
109
  intent?: string;
111
110
  customerRef?: string;
112
111
  variant?: VuetifyProps['variant'];
@@ -213,14 +212,6 @@ export type P_ProductLine = {
213
212
  demo?: boolean;
214
213
  provider?: string;
215
214
  };
216
- export interface PaymentMethodRestrictions {
217
- type: string[];
218
- binType?: string[];
219
- cardCategory?: string[];
220
- brand?: string[];
221
- bin?: string[];
222
- accountType?: string[];
223
- }
224
215
  export interface PaymentMethodCustom {
225
216
  originatingId?: string;
226
217
  type: PaymentMethodType;
@@ -268,3 +259,18 @@ export interface PaymentMethodConfigItem {
268
259
  };
269
260
  error?: string;
270
261
  }
262
+ /**
263
+ * Options for `AuthviaPaymentMethodFormPlugin` via `app.use(plugin, options)`.
264
+ * Use when embedding in another Vue app so host config does not depend on this package's `import.meta.env`.
265
+ * CDN and web-component-specific setup remain in `src/entry/web-component.ts`.
266
+ */
267
+ export interface AuthviaPaymentMethodFormPluginOptions {
268
+ apiBaseURL: string;
269
+ googleAPIKey: string;
270
+ isPlaidVisible: boolean;
271
+ pazeSDKURL: string;
272
+ plaidEnv: string;
273
+ paypalSDKURL: string;
274
+ paypalClientId: string;
275
+ paypalEnvironment?: string;
276
+ }
@@ -1,5 +1,5 @@
1
1
  import { PaymentMethodBillingAddress } from '../model';
2
- import { PaymentMethodRestrictions, PaymentMethodDisplayConfigMap, TermsConfig } from '.';
2
+ import { PaymentMethodDisplayConfigMap, TermsConfig } from '.';
3
3
  /**
4
4
  * Public props for {@link AuthviaPaymentMethodOptions} (options chooser + dialogs).
5
5
  */
@@ -29,6 +29,5 @@ export interface PaymentMethodOptionsProps {
29
29
  color?: string;
30
30
  borderRadius?: string;
31
31
  variant?: string;
32
- restrictions?: PaymentMethodRestrictions[];
33
32
  vuetifyOverrides?: string;
34
33
  }
@@ -1,4 +1,3 @@
1
- import { PaymentMethodRestrictions } from '../types';
2
1
  export declare const isMobile: () => boolean;
3
2
  /**
4
3
  * @param str Input string
@@ -18,9 +17,6 @@ export declare function hasPaymentMethodsReadScope(token: string | undefined): b
18
17
  */
19
18
  export declare const merchantThemeColor: () => any;
20
19
  export declare const transformPaymentMethodType: (type: string) => string;
21
- export declare const generateRestrictionStatementsFromArray: (restrictions: PaymentMethodRestrictions[]) => string[];
22
- export declare const checkRestrictions: (restrictionValues: string[] | undefined, paymentMethodValue: string | undefined) => boolean;
23
- export declare const checkBinRestrictions: (binRestrictions: string[] | undefined, paymentMethodBin: string | undefined) => boolean;
24
20
  /**
25
21
  * Extracts the user ID and token from an auth token.
26
22
  * @param authToken - The authentication token string.
@@ -7,10 +7,12 @@ export declare function hasPaypalClientIdInEnv(): boolean;
7
7
  * PayPal JS SDK `client-id` from `VITE_APP_PAYPAL_CLIENT_ID` only (not from props).
8
8
  */
9
9
  export declare function getPaypalClientIdFromEnv(): string;
10
+ export declare function getPaypalClientId(): string;
10
11
  /**
11
12
  * PayPal JS SDK script base URL from `VITE_PAYPAL_SDK_URL` (trimmed).
12
13
  */
13
14
  export declare function getPaypalSdkUrlFromEnv(): string;
15
+ export declare function getPaypalSdkUrl(): string;
14
16
  /**
15
17
  * True when `url` is non-empty and an absolute `http:` / `https:` URL with a host.
16
18
  * Empty or relative-looking values would yield `?client-id=...` and load the wrong origin.
@@ -0,0 +1,6 @@
1
+ export declare function resolvePaypalClientId(): string;
2
+ export declare function resolveGoogleMapsApiKey(): string;
3
+ export declare function resolvePaypalSdkUrl(): string;
4
+ export declare function resolvePazeSdkUrl(): string;
5
+ export declare function resolvePaypalEnvironment(): string;
6
+ export declare function resolvePlaidEnv(): string;
@@ -1,6 +1,6 @@
1
1
  export * from '../entry/index'
2
2
  export {}
3
- import AuthviaCustomerAuthentication from '../entry/index'
4
- export default AuthviaCustomerAuthentication
3
+ import AuthviaPaymentMethodCreate from '../entry/index'
4
+ export default AuthviaPaymentMethodCreate
5
5
  export * from '../entry/index'
6
6
  export {}