@authvia/payment-method-create 0.2.1 → 0.3.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/dist/components/AuthviaPaymentMethodForm.vue.d.ts +1 -1
- package/dist/components/internal/AuthviaPaymentMethodAddPaymentsPayPal.vue.d.ts +52 -0
- package/dist/types/index.d.ts +10 -3
- package/dist/utils/paypalConfig.d.ts +26 -1
- package/dist/utils/paypalWebSdkSessionKey.d.ts +5 -0
- package/dist/vue-plugin.js +2 -2
- package/dist/vue-plugin.umd.cjs +2 -2
- package/package.json +1 -1
|
@@ -39,7 +39,7 @@ declare const _default: import('vue').DefineComponent<Props, {
|
|
|
39
39
|
country?: string;
|
|
40
40
|
postalCode?: string;
|
|
41
41
|
};
|
|
42
|
-
venmo: boolean;
|
|
42
|
+
venmo: boolean | import('../types').VenmoConfig;
|
|
43
43
|
color: string;
|
|
44
44
|
forgetDefault: boolean | string;
|
|
45
45
|
customerRef: string;
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { PaymentMethodType } from '../../model';
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
authToken: string;
|
|
4
|
+
merchantId?: string;
|
|
5
|
+
customerRef?: string;
|
|
6
|
+
intent?: string;
|
|
7
|
+
type?: 'paypal' | 'venmo';
|
|
8
|
+
pvSettings?: Record<string, unknown>;
|
|
9
|
+
};
|
|
10
|
+
declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
11
|
+
error: (payload: {
|
|
12
|
+
message: string;
|
|
13
|
+
}) => any;
|
|
14
|
+
success: (payload: {
|
|
15
|
+
id: string;
|
|
16
|
+
forgetCard?: boolean;
|
|
17
|
+
}) => any;
|
|
18
|
+
submit: (payload: {
|
|
19
|
+
payload: {
|
|
20
|
+
type: PaymentMethodType;
|
|
21
|
+
traits: {
|
|
22
|
+
setupToken: string;
|
|
23
|
+
};
|
|
24
|
+
};
|
|
25
|
+
}) => any;
|
|
26
|
+
}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
27
|
+
onError?: ((payload: {
|
|
28
|
+
message: string;
|
|
29
|
+
}) => any) | undefined;
|
|
30
|
+
onSuccess?: ((payload: {
|
|
31
|
+
id: string;
|
|
32
|
+
forgetCard?: boolean;
|
|
33
|
+
}) => any) | undefined;
|
|
34
|
+
onSubmit?: ((payload: {
|
|
35
|
+
payload: {
|
|
36
|
+
type: PaymentMethodType;
|
|
37
|
+
traits: {
|
|
38
|
+
setupToken: string;
|
|
39
|
+
};
|
|
40
|
+
};
|
|
41
|
+
}) => any) | undefined;
|
|
42
|
+
}>, {
|
|
43
|
+
type: "paypal" | "venmo";
|
|
44
|
+
merchantId: string;
|
|
45
|
+
customerRef: string;
|
|
46
|
+
intent: string;
|
|
47
|
+
pvSettings: Record<string, unknown>;
|
|
48
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
|
|
49
|
+
paypalButtonContainerRef: HTMLDivElement;
|
|
50
|
+
venmoButtonContainerRef: HTMLDivElement;
|
|
51
|
+
}, HTMLDivElement>;
|
|
52
|
+
export default _default;
|
package/dist/types/index.d.ts
CHANGED
|
@@ -21,13 +21,19 @@ export interface TermsConfig {
|
|
|
21
21
|
termsOfService?: TermsLinkConfig;
|
|
22
22
|
}
|
|
23
23
|
/**
|
|
24
|
-
* Object shape when the `paypal` prop is a config object (not boolean `true`).
|
|
24
|
+
* Object shape when the `paypal` or `venmo` prop is a config object (not boolean `true`).
|
|
25
|
+
* Venmo-only flows use the same PayPal JS SDK; pass `venmo: { merchantId, redirectUrl? }` without `paypal`.
|
|
25
26
|
*/
|
|
26
27
|
export type PayPalConfig = {
|
|
27
28
|
merchantId: string;
|
|
28
|
-
|
|
29
|
+
/**
|
|
30
|
+
* PayPal REST client id comes from `VITE_APP_PAYPAL_CLIENT_ID` only.
|
|
31
|
+
* A legacy `clientId` field on JSON payloads is tolerated at runtime but ignored.
|
|
32
|
+
*/
|
|
29
33
|
redirectUrl?: string;
|
|
30
34
|
};
|
|
35
|
+
/** Alias for Venmo wallet config; same fields as {@link PayPalConfig}. */
|
|
36
|
+
export type VenmoConfig = PayPalConfig;
|
|
31
37
|
/** Allowed values for Vuetify 3 `v-text-field` / field `variant` (shared across payment method components). */
|
|
32
38
|
export declare const VUETIFY_FIELD_VARIANTS: readonly ["outlined", "plain", "underlined", "filled", "solo", "solo-filled", "solo-inverted"];
|
|
33
39
|
export type VuetifyFieldVariant = (typeof VUETIFY_FIELD_VARIANTS)[number];
|
|
@@ -69,7 +75,8 @@ export interface AuthviaPaymentMethodFormProps {
|
|
|
69
75
|
postalCode?: string;
|
|
70
76
|
};
|
|
71
77
|
paypal?: boolean | PayPalConfig;
|
|
72
|
-
|
|
78
|
+
/** `true`, or `{ merchantId, redirectUrl? }` when you want Venmo without a `paypal` prop. */
|
|
79
|
+
venmo?: boolean | VenmoConfig;
|
|
73
80
|
paze?: {
|
|
74
81
|
amount?: string;
|
|
75
82
|
clientId?: string;
|
|
@@ -1,5 +1,30 @@
|
|
|
1
1
|
import { PayPalConfig } from '../types';
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
3
|
+
* True if `VITE_APP_PAYPAL_CLIENT_ID` is set in the build environment (one client id per deployment).
|
|
4
|
+
*/
|
|
5
|
+
export declare function hasPaypalClientIdInEnv(): boolean;
|
|
6
|
+
/**
|
|
7
|
+
* PayPal JS SDK `client-id` from `VITE_APP_PAYPAL_CLIENT_ID` only (not from props).
|
|
8
|
+
*/
|
|
9
|
+
export declare function getPaypalClientIdFromEnv(): string;
|
|
10
|
+
/**
|
|
11
|
+
* PayPal JS SDK script base URL from `VITE_PAYPAL_SDK_URL` (trimmed).
|
|
12
|
+
*/
|
|
13
|
+
export declare function getPaypalSdkUrlFromEnv(): string;
|
|
14
|
+
/**
|
|
15
|
+
* True when `url` is non-empty and an absolute `http:` / `https:` URL with a host.
|
|
16
|
+
* Empty or relative-looking values would yield `?client-id=...` and load the wrong origin.
|
|
17
|
+
*
|
|
18
|
+
* @param url - Candidate base URL (typically from env via `getPaypalSdkUrlFromEnv()`)
|
|
19
|
+
*/
|
|
20
|
+
export declare function isValidPaypalSdkBaseUrl(url: string): boolean;
|
|
21
|
+
/**
|
|
22
|
+
* Type guard: PayPal module config (`merchantId` required; optional `redirectUrl`).
|
|
23
|
+
* Legacy embeds may still send `clientId` on this object; it is ignored — the JS SDK uses
|
|
24
|
+
* `VITE_APP_PAYPAL_CLIENT_ID` only (validated on click).
|
|
4
25
|
*/
|
|
5
26
|
export declare function isPayPalConfig(value: unknown): value is PayPalConfig;
|
|
27
|
+
/**
|
|
28
|
+
* Type guard: Venmo-only wallet config (same shape as PayPal; no `paypal` prop required).
|
|
29
|
+
*/
|
|
30
|
+
export declare function isVenmoWalletConfig(value: unknown): value is PayPalConfig;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `window` property storing the fingerprint of the last PayPal JS SDK load (funding mode, env, etc.).
|
|
3
|
+
* Used by `AuthviaPaymentMethodAddPaymentsPayPal.vue` and cleared in PayPal-related Vitest hooks.
|
|
4
|
+
*/
|
|
5
|
+
export declare const AUTHVIA_PAYPAL_SDK_SESSION_KEY: string;
|