@authvia/payment-method-create 1.0.19 → 2.0.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.
- package/dist/components/AuthviaPaymentMethodForm.vue.d.ts +5 -4
- package/dist/components/internal/AuthviaApplePayForm.vue.d.ts +31 -0
- package/dist/components/internal/AuthviaPaymentMethodAddAch.vue.d.ts +2 -2
- package/dist/components/internal/AuthviaPaymentMethodAddPayoutsPayPal.vue.d.ts +2 -2
- package/dist/components/internal/AuthviaPaymentMethodCreditCard.vue.d.ts +2 -2
- package/dist/components/internal/AuthviaPaymentMethodOptions.vue.d.ts +67 -13
- package/dist/components/internal/AuthviaPazeForm.vue.d.ts +2 -2
- package/dist/composables/applePay/attachApplePaySessionHandlers.d.ts +15 -0
- package/dist/composables/applePay/sdkCredentials.d.ts +10 -0
- package/dist/composables/applePay/sdkLoader.d.ts +11 -0
- package/dist/composables/applePay/sdkSession.d.ts +13 -0
- package/dist/composables/applePay/sdkTypes.d.ts +22 -0
- package/dist/composables/applePay/sessionErrorMessages.d.ts +4 -0
- package/dist/composables/applePay/sessionPaymentRequest.d.ts +15 -0
- package/dist/composables/applePay/sessionStartTypes.d.ts +2 -0
- package/dist/composables/applePay/startApplePaySessionFlow.d.ts +6 -0
- package/dist/composables/paymentMethodForm/useAuthviaPaymentMethodForm.d.ts +1 -0
- package/dist/composables/paymentMethodForm/usePaymentMethodFormChildProps.d.ts +1 -0
- package/dist/composables/paymentMethodOptions/useAuthviaPaymentMethodOptions.d.ts +15 -5
- package/dist/composables/paymentMethodOptions/usePaymentMethodOptionsHandlers.d.ts +6 -0
- package/dist/composables/paymentMethodOptions/usePaymentMethodOptionsState.d.ts +3 -0
- package/dist/composables/useApplePayPaymentMethodCreate.d.ts +15 -0
- package/dist/composables/useApplePaySDK.d.ts +12 -0
- package/dist/composables/useApplePaySessionStart.d.ts +6 -0
- package/dist/composables/useHostService.d.ts +2 -1
- package/dist/composables/usePaymentMethodService.d.ts +5 -0
- package/dist/model/PaymentMethod.d.ts +2 -1
- package/dist/types/applePay/common.d.ts +8 -0
- package/dist/types/applePay/config.d.ts +82 -0
- package/dist/types/applePay/index.d.ts +8 -0
- package/dist/types/applePay/payment.d.ts +38 -0
- package/dist/types/applePay/sdk.d.ts +93 -0
- package/dist/types/applePay/session.d.ts +30 -0
- package/dist/types/index.d.ts +10 -1
- package/dist/types/paymentMethodOptions.d.ts +2 -0
- package/dist/utils/applePay/constants.d.ts +9 -0
- package/dist/utils/applePay/deferredFlow.d.ts +18 -0
- package/dist/utils/applePay/device.d.ts +9 -0
- package/dist/utils/applePay/diagnostics.d.ts +12 -0
- package/dist/utils/applePay/paymentPayload.d.ts +14 -0
- package/dist/utils/applePay/propAccess.d.ts +23 -0
- package/dist/utils/applePay/recurringFlow.d.ts +20 -0
- package/dist/utils/applePay/sessionToken.d.ts +5 -0
- package/dist/utils/applePay/strings.d.ts +3 -0
- package/dist/utils/applePay/surcharge.d.ts +33 -0
- package/dist/utils/applePay/types.d.ts +2 -0
- package/dist/utils/applePayConfig.d.ts +14 -0
- package/dist/utils/applePaySdkConfig.d.ts +14 -0
- package/dist/utils/runtimeConfig.d.ts +1 -0
- package/dist/vue-plugin.js +2 -2
- package/dist/vue-plugin.umd.cjs +2 -2
- package/package.json +20 -12
|
@@ -14,6 +14,7 @@ declare const _default: import('vue').DefineComponent<Props, {
|
|
|
14
14
|
onReady?: (() => any) | undefined;
|
|
15
15
|
"onPayment-method-created"?: ((paymentMethodId: string) => any) | undefined;
|
|
16
16
|
}>, {
|
|
17
|
+
token: string;
|
|
17
18
|
ach: {
|
|
18
19
|
demoMode?: boolean;
|
|
19
20
|
online?: boolean;
|
|
@@ -56,14 +57,14 @@ declare const _default: import('vue').DefineComponent<Props, {
|
|
|
56
57
|
name?: string;
|
|
57
58
|
};
|
|
58
59
|
venmo: boolean | import('../types').VenmoConfig;
|
|
60
|
+
applePay: boolean | import('../types/applePay').ApplePayConfig;
|
|
59
61
|
variant: "outlined" | "plain" | "underlined" | "filled" | "solo" | "solo-filled" | "solo-inverted";
|
|
60
62
|
merchantId: string;
|
|
61
|
-
token: string;
|
|
62
63
|
customerRef: string;
|
|
63
|
-
color: string;
|
|
64
|
-
forgetDefault: boolean | string;
|
|
65
|
-
forgetHidden: boolean | string;
|
|
66
64
|
intent: string;
|
|
65
|
+
forgetHidden: boolean | string;
|
|
66
|
+
forgetDefault: boolean | string;
|
|
67
|
+
color: string;
|
|
67
68
|
borderRadius: string;
|
|
68
69
|
vuetifyOverrides: string;
|
|
69
70
|
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { PaymentMethodErrorPayload } from '../../types';
|
|
2
|
+
import { ApplePayConfig } from '../../utils/applePayConfig';
|
|
3
|
+
type __VLS_Props = {
|
|
4
|
+
applePay?: boolean | ApplePayConfig;
|
|
5
|
+
merchantId?: string;
|
|
6
|
+
authToken?: string;
|
|
7
|
+
customerRef?: string;
|
|
8
|
+
intent?: string;
|
|
9
|
+
};
|
|
10
|
+
declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
11
|
+
success: (paymentMethodId: string | {
|
|
12
|
+
id: string;
|
|
13
|
+
forgetCard?: boolean;
|
|
14
|
+
}) => any;
|
|
15
|
+
error: (error: PaymentMethodErrorPayload) => any;
|
|
16
|
+
cancel: () => any;
|
|
17
|
+
}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
18
|
+
onSuccess?: ((paymentMethodId: string | {
|
|
19
|
+
id: string;
|
|
20
|
+
forgetCard?: boolean;
|
|
21
|
+
}) => any) | undefined;
|
|
22
|
+
onError?: ((error: PaymentMethodErrorPayload) => any) | undefined;
|
|
23
|
+
onCancel?: (() => any) | undefined;
|
|
24
|
+
}>, {
|
|
25
|
+
applePay: boolean | ApplePayConfig;
|
|
26
|
+
merchantId: string;
|
|
27
|
+
authToken: string;
|
|
28
|
+
customerRef: string;
|
|
29
|
+
intent: string;
|
|
30
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLDivElement>;
|
|
31
|
+
export default _default;
|
|
@@ -206,10 +206,10 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
|
|
|
206
206
|
onSubmit?: ((...args: any[]) => any) | undefined;
|
|
207
207
|
}>, {
|
|
208
208
|
variant: string;
|
|
209
|
-
|
|
209
|
+
forgetHidden: boolean;
|
|
210
210
|
forgetDefault: boolean;
|
|
211
|
+
selectionMode: AchAddressSelectionMode;
|
|
211
212
|
demoMode: boolean;
|
|
212
|
-
forgetHidden: boolean;
|
|
213
213
|
}, {}, {
|
|
214
214
|
AchFormPlaidBannerAndTypeToggle: import('vue').DefineComponent<import('vue').ExtractPropTypes<{
|
|
215
215
|
plaid: {
|
|
@@ -36,9 +36,9 @@ declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {
|
|
|
36
36
|
variant: Variant | string;
|
|
37
37
|
merchantId: string;
|
|
38
38
|
customerRef: string;
|
|
39
|
+
intent: string;
|
|
39
40
|
terms: TermsConfig;
|
|
40
|
-
forgetDefault: boolean;
|
|
41
41
|
forgetHidden: boolean;
|
|
42
|
-
|
|
42
|
+
forgetDefault: boolean;
|
|
43
43
|
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLDivElement>;
|
|
44
44
|
export default _default;
|
|
@@ -201,11 +201,11 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
|
|
|
201
201
|
onError?: ((...args: any[]) => any) | undefined;
|
|
202
202
|
}>, {
|
|
203
203
|
variant: string;
|
|
204
|
+
forgetHidden: boolean;
|
|
205
|
+
forgetDefault: boolean;
|
|
204
206
|
color: string;
|
|
205
207
|
selectionMode: "default" | "collapse";
|
|
206
208
|
submitLabel: string;
|
|
207
|
-
forgetDefault: boolean;
|
|
208
209
|
demoMode: boolean;
|
|
209
|
-
forgetHidden: boolean;
|
|
210
210
|
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
211
211
|
export default _default;
|
|
@@ -96,6 +96,11 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
|
|
|
96
96
|
required: false;
|
|
97
97
|
default: () => {};
|
|
98
98
|
};
|
|
99
|
+
apSettings: {
|
|
100
|
+
type: PropType<Record<string, unknown>>;
|
|
101
|
+
required: false;
|
|
102
|
+
default: () => {};
|
|
103
|
+
};
|
|
99
104
|
forgetHidden: {
|
|
100
105
|
type: BooleanConstructor;
|
|
101
106
|
default: boolean;
|
|
@@ -124,11 +129,12 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
|
|
|
124
129
|
}>, {
|
|
125
130
|
defaultCardSubmitBtnText: any;
|
|
126
131
|
defaultAchSubmitBtnText: any;
|
|
127
|
-
cardDemoMode: boolean | undefined
|
|
128
|
-
achDemoMode: boolean | undefined
|
|
129
|
-
achSelectionMode: "default" | "collapse" | undefined
|
|
130
|
-
pzSettings: Record<string, unknown> | undefined
|
|
131
|
-
|
|
132
|
+
cardDemoMode: import('vue').Ref<boolean | undefined, boolean | undefined>;
|
|
133
|
+
achDemoMode: import('vue').Ref<boolean | undefined, boolean | undefined>;
|
|
134
|
+
achSelectionMode: import('vue').Ref<"default" | "collapse" | undefined, "default" | "collapse" | undefined>;
|
|
135
|
+
pzSettings: import('vue').Ref<Record<string, unknown> | undefined, Record<string, unknown> | undefined>;
|
|
136
|
+
apSettings: import('vue').Ref<Record<string, unknown> | undefined, Record<string, unknown> | undefined>;
|
|
137
|
+
vuetifyOverrides: import('vue').Ref<string | undefined, string | undefined>;
|
|
132
138
|
closePaymentMethodForm: () => void;
|
|
133
139
|
handlePaymentMethodClick: (type: string) => void;
|
|
134
140
|
handleAchOptions: () => void;
|
|
@@ -142,6 +148,12 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
|
|
|
142
148
|
type?: import('../../model').PaymentMethodType;
|
|
143
149
|
}) => void;
|
|
144
150
|
handlePazeCancel: () => void;
|
|
151
|
+
handleApplePaySuccess: (data: import('../../composables/paymentMethodOptions/paymentMethodOptionsTypes').PazeSuccessPayload) => void;
|
|
152
|
+
handleApplePayError: (error: {
|
|
153
|
+
message: string;
|
|
154
|
+
type?: import('../../model').PaymentMethodType;
|
|
155
|
+
}) => void;
|
|
156
|
+
handleApplePayCancel: () => void;
|
|
145
157
|
handleCreditCardSuccess: (data: import('../../composables/paymentMethodOptions/paymentMethodOptionsTypes').MethodSuccessPayload | null) => void;
|
|
146
158
|
handleCreditCardError: (error: {
|
|
147
159
|
message: string;
|
|
@@ -176,6 +188,9 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
|
|
|
176
188
|
showACHForm: import('vue').Ref<boolean>;
|
|
177
189
|
showACHOptions: import('vue').Ref<boolean>;
|
|
178
190
|
showPazeForm: import('vue').Ref<boolean>;
|
|
191
|
+
showApplePayInline: import('vue').Ref<boolean>;
|
|
192
|
+
showApplePayQrActive: import('vue').Ref<boolean>;
|
|
193
|
+
applePaySessionInFlight: import('vue').Ref<boolean>;
|
|
179
194
|
showPlaidOption: import('vue').Ref<boolean>;
|
|
180
195
|
showConfirmLoader: import('vue').Ref<boolean>;
|
|
181
196
|
errorMessage: import('vue').Ref<string>;
|
|
@@ -290,6 +305,11 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
|
|
|
290
305
|
required: false;
|
|
291
306
|
default: () => {};
|
|
292
307
|
};
|
|
308
|
+
apSettings: {
|
|
309
|
+
type: PropType<Record<string, unknown>>;
|
|
310
|
+
required: false;
|
|
311
|
+
default: () => {};
|
|
312
|
+
};
|
|
293
313
|
forgetHidden: {
|
|
294
314
|
type: BooleanConstructor;
|
|
295
315
|
default: boolean;
|
|
@@ -322,17 +342,18 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
|
|
|
322
342
|
"onOn-submit"?: ((...args: any[]) => any) | undefined;
|
|
323
343
|
}>, {
|
|
324
344
|
variant: string;
|
|
325
|
-
|
|
326
|
-
forgetDefault: boolean;
|
|
327
|
-
forgetHidden: boolean;
|
|
345
|
+
cardDemoMode: boolean;
|
|
328
346
|
intent: string;
|
|
347
|
+
allowedPaymentMethodTypes: string[];
|
|
348
|
+
achOnline: boolean;
|
|
329
349
|
achDemoMode: boolean;
|
|
350
|
+
cardSelectionMode: "default" | "collapse";
|
|
330
351
|
achSelectionMode: AchAddressSelectionMode;
|
|
352
|
+
pzSettings: Record<string, unknown>;
|
|
331
353
|
pvSettings: Record<string, unknown>;
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
achOnline: boolean;
|
|
354
|
+
apSettings: Record<string, unknown>;
|
|
355
|
+
forgetHidden: boolean;
|
|
356
|
+
forgetDefault: boolean;
|
|
336
357
|
}, {}, {
|
|
337
358
|
AuthviaPazeForm: import('vue').DefineComponent<{
|
|
338
359
|
pzSettings?: {
|
|
@@ -375,14 +396,47 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
|
|
|
375
396
|
}>, {
|
|
376
397
|
merchantId: string;
|
|
377
398
|
amount: number;
|
|
399
|
+
authToken: string;
|
|
400
|
+
customerRef: string;
|
|
378
401
|
pzSettings: {
|
|
379
402
|
clientId?: string;
|
|
380
403
|
name?: string;
|
|
381
404
|
profileId?: string;
|
|
382
405
|
};
|
|
406
|
+
autoStart: boolean;
|
|
407
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLDivElement>;
|
|
408
|
+
AuthviaApplePayForm: import('vue').DefineComponent<{
|
|
409
|
+
applePay?: boolean | import('../../types/applePay').ApplePayConfig;
|
|
410
|
+
merchantId?: string;
|
|
411
|
+
authToken?: string;
|
|
412
|
+
customerRef?: string;
|
|
413
|
+
intent?: string;
|
|
414
|
+
}, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
415
|
+
success: (paymentMethodId: string | {
|
|
416
|
+
id: string;
|
|
417
|
+
forgetCard?: boolean;
|
|
418
|
+
}) => any;
|
|
419
|
+
error: (error: import('../../types').PaymentMethodErrorPayload) => any;
|
|
420
|
+
cancel: () => any;
|
|
421
|
+
}, string, import('vue').PublicProps, Readonly<{
|
|
422
|
+
applePay?: boolean | import('../../types/applePay').ApplePayConfig;
|
|
423
|
+
merchantId?: string;
|
|
424
|
+
authToken?: string;
|
|
425
|
+
customerRef?: string;
|
|
426
|
+
intent?: string;
|
|
427
|
+
}> & Readonly<{
|
|
428
|
+
onSuccess?: ((paymentMethodId: string | {
|
|
429
|
+
id: string;
|
|
430
|
+
forgetCard?: boolean;
|
|
431
|
+
}) => any) | undefined;
|
|
432
|
+
onError?: ((error: import('../../types').PaymentMethodErrorPayload) => any) | undefined;
|
|
433
|
+
onCancel?: (() => any) | undefined;
|
|
434
|
+
}>, {
|
|
435
|
+
applePay: boolean | import('../../types/applePay').ApplePayConfig;
|
|
436
|
+
merchantId: string;
|
|
383
437
|
authToken: string;
|
|
384
438
|
customerRef: string;
|
|
385
|
-
|
|
439
|
+
intent: string;
|
|
386
440
|
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLDivElement>;
|
|
387
441
|
AuthviaPaymentMethodOptionsAchFlowDialogs: import('vue').DefineComponent<{
|
|
388
442
|
modelValue: boolean;
|
|
@@ -45,13 +45,13 @@ declare const _default: import('vue').DefineComponent<{
|
|
|
45
45
|
}>, {
|
|
46
46
|
merchantId: string;
|
|
47
47
|
amount: number;
|
|
48
|
+
authToken: string;
|
|
49
|
+
customerRef: string;
|
|
48
50
|
pzSettings: {
|
|
49
51
|
clientId?: string;
|
|
50
52
|
name?: string;
|
|
51
53
|
profileId?: string;
|
|
52
54
|
};
|
|
53
|
-
authToken: string;
|
|
54
|
-
customerRef: string;
|
|
55
55
|
autoStart: boolean;
|
|
56
56
|
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLDivElement>;
|
|
57
57
|
export default _default;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { ApplePayPaymentRequest, ApplePaySessionInstance } from '../../types/applePay/sdk';
|
|
2
|
+
import { Logger } from '../../utils/logger';
|
|
3
|
+
import { ApplePaySessionDiagnostics, ApplePaySessionStartCallbacks, ApplePaySessionStartInput } from '../../types/applePay/session';
|
|
4
|
+
export interface AttachApplePaySessionHandlersOptions {
|
|
5
|
+
session: ApplePaySessionInstance;
|
|
6
|
+
input: ApplePaySessionStartInput;
|
|
7
|
+
callbacks: ApplePaySessionStartCallbacks;
|
|
8
|
+
sessionDiagnostics: ApplePaySessionDiagnostics;
|
|
9
|
+
paymentRequest: ApplePayPaymentRequest;
|
|
10
|
+
settle: (emit: () => void) => void;
|
|
11
|
+
claimSettlement: () => boolean;
|
|
12
|
+
logger: Logger;
|
|
13
|
+
}
|
|
14
|
+
/** Wires Apple Pay session callbacks for cancel, validation, authorization, and surcharge. */
|
|
15
|
+
export declare function attachApplePaySessionHandlers(options: AttachApplePaySessionHandlersOptions): void;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ApplePayCredentialStatus } from '../../types/applePay/sdk';
|
|
2
|
+
/**
|
|
3
|
+
* Resolves whether the Apple Pay button should be shown, after the SDK has loaded.
|
|
4
|
+
*
|
|
5
|
+
* Uses `applePayCapabilities()` when a merchant identifier is configured, since it is the
|
|
6
|
+
* only check that reports correctly in non-Safari browsers. Falls back to `canMakePayments()`.
|
|
7
|
+
*/
|
|
8
|
+
export declare function getApplePayCredentialStatus(merchantIdentifier: string): Promise<ApplePayCredentialStatus>;
|
|
9
|
+
/** Apple's guidance: show the button for every status except `applePayUnsupported`. */
|
|
10
|
+
export declare function shouldShowApplePayButton(status: ApplePayCredentialStatus): boolean;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/** True once the SDK has defined `ApplePaySession`; it is absent in non-Safari browsers until then. */
|
|
2
|
+
export declare function isApplePaySessionDefined(): boolean;
|
|
3
|
+
/**
|
|
4
|
+
* Injects the Apple Pay SDK into the top-level document once and resolves when ready.
|
|
5
|
+
*
|
|
6
|
+
* Injected into `document.head` rather than the shadow root so the custom element registers
|
|
7
|
+
* globally and Apple's handoff overlay can attach outside the web component.
|
|
8
|
+
*/
|
|
9
|
+
export declare function loadApplePaySDK(): Promise<void>;
|
|
10
|
+
/** Test seam; clears the cached loader promise. */
|
|
11
|
+
export declare function resetApplePaySDKLoader(): void;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { ApplePayPaymentRequest, ApplePaySessionInstance } from '../../types/applePay/sdk';
|
|
2
|
+
/**
|
|
3
|
+
* Highest supported Apple Pay version at or below the preferred one.
|
|
4
|
+
*
|
|
5
|
+
* Constructing an `ApplePaySession` with a version the device does not support throws, so the
|
|
6
|
+
* version is negotiated rather than hardcoded.
|
|
7
|
+
*/
|
|
8
|
+
export declare function resolveApplePayApiVersion(preferred?: number): number;
|
|
9
|
+
/**
|
|
10
|
+
* Creates an Apple Pay session. Calling `begin()` on the result is what renders the
|
|
11
|
+
* scan-with-iPhone code in non-Safari browsers.
|
|
12
|
+
*/
|
|
13
|
+
export declare function createApplePaySession(request: ApplePayPaymentRequest, version?: number): ApplePaySessionInstance;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Apple Pay JS SDK runtime constants and global augmentation.
|
|
3
|
+
* Type shapes live in `@/types/applePay/sdk`.
|
|
4
|
+
*/
|
|
5
|
+
export type { ApplePayBillingContactField, ApplePayCapabilitiesResponse, ApplePayCardType, ApplePayCredentialStatus, ApplePayDeferredPaymentRequest, ApplePayLineItem, ApplePayLineItemType, ApplePayPaymentMethodUpdate, ApplePayPaymentRequest, ApplePayRecurringInterval, ApplePayRecurringPaymentRequest, ApplePaySelectedPaymentMethod, ApplePaySessionInstance, ApplePaySessionStatic, } from '../../types/applePay/sdk';
|
|
6
|
+
/** ApplePaySession.STATUS_SUCCESS */
|
|
7
|
+
export declare const APPLE_PAY_SESSION_STATUS_SUCCESS: number;
|
|
8
|
+
/** ApplePaySession.STATUS_FAILURE */
|
|
9
|
+
export declare const APPLE_PAY_SESSION_STATUS_FAILURE: number;
|
|
10
|
+
/** Back-compat alias; prefer {@link getApplePayMinApiVersion}. */
|
|
11
|
+
export declare const APPLE_PAY_MIN_API_VERSION: number;
|
|
12
|
+
/** Back-compat alias; prefer {@link getApplePayZeroTotalApiVersion}. */
|
|
13
|
+
export declare const APPLE_PAY_ZERO_TOTAL_API_VERSION: number;
|
|
14
|
+
/** Back-compat alias; prefer {@link getApplePayPreferredApiVersion}. */
|
|
15
|
+
export declare const APPLE_PAY_PREFERRED_API_VERSION: number;
|
|
16
|
+
/** Back-compat alias; prefer {@link getApplePayDeferredApiVersion}. */
|
|
17
|
+
export declare const APPLE_PAY_DEFERRED_API_VERSION: number;
|
|
18
|
+
declare global {
|
|
19
|
+
interface Window {
|
|
20
|
+
ApplePaySession?: import('@/types/applePay/sdk').ApplePaySessionStatic;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
/** Maps session start failures to user-facing copy (HTTPS vs lost user gesture). */
|
|
2
|
+
export declare function resolveApplePayStartErrorMessage(error: unknown): string;
|
|
3
|
+
export declare function resolveMerchantValidationErrorMessage(error: unknown): string;
|
|
4
|
+
export declare function resolveApplePayPaymentErrorMessage(error: unknown): string;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { ApplePayBillingContactField, ApplePayPaymentRequest } from '../../types/applePay/sdk';
|
|
2
|
+
import { ApplePayConfig } from '../../utils/applePayConfig';
|
|
3
|
+
/**
|
|
4
|
+
* Apple's encrypted `paymentData` carries no billing details, so they reach Authvia only when
|
|
5
|
+
* requested here and forwarded from the plaintext `billingContact`.
|
|
6
|
+
*/
|
|
7
|
+
export declare const DEFAULT_REQUIRED_BILLING_CONTACT_FIELDS: ApplePayBillingContactField[];
|
|
8
|
+
/**
|
|
9
|
+
* Normalized total amount. Apple requires a `total` on every request - there is no save-only
|
|
10
|
+
* mode - so a card-on-file flow with no amount still sends one, as zero.
|
|
11
|
+
*/
|
|
12
|
+
export declare function resolveTotalAmount(applePay: boolean | ApplePayConfig | undefined): string;
|
|
13
|
+
/** Label on the total row - Apple's guidance is the name on the customer's statement. */
|
|
14
|
+
export declare function resolveTotalLabel(applePay: boolean | ApplePayConfig | undefined, merchantId?: string): string;
|
|
15
|
+
export declare function buildPaymentRequest(applePay: boolean | ApplePayConfig | undefined, merchantId?: string): ApplePayPaymentRequest;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { ApplePaySessionStartCallbacks, ApplePaySessionStartInput } from '../../types/applePay/session';
|
|
2
|
+
/**
|
|
3
|
+
* Starts an Apple Pay session synchronously inside a user-gesture handler.
|
|
4
|
+
* Safari opens the native sheet; Chrome opens the scan-with-iPhone QR overlay.
|
|
5
|
+
*/
|
|
6
|
+
export declare function startApplePaySessionFlow(input: ApplePaySessionStartInput, callbacks: ApplePaySessionStartCallbacks): void;
|
|
@@ -29,6 +29,7 @@ export declare function useAuthviaPaymentMethodForm(props: AuthviaPaymentMethodF
|
|
|
29
29
|
forgetDefault: import('vue').ComputedRef<boolean | undefined>;
|
|
30
30
|
pzSettings: import('vue').ComputedRef<Record<string, unknown>>;
|
|
31
31
|
pvSettings: import('vue').ComputedRef<Record<string, unknown>>;
|
|
32
|
+
apSettings: import('vue').ComputedRef<Record<string, unknown>>;
|
|
32
33
|
rootRef: import('vue').Ref<HTMLElement | null, HTMLElement | null>;
|
|
33
34
|
avwcPaymentMethodFormHooks: {
|
|
34
35
|
readonly root: "avwc-payment-method-form__root";
|
|
@@ -24,4 +24,5 @@ export declare function usePaymentMethodFormChildProps(props: AuthviaPaymentMeth
|
|
|
24
24
|
forgetDefault: ComputedRef<boolean | undefined>;
|
|
25
25
|
pzSettings: ComputedRef<Record<string, unknown>>;
|
|
26
26
|
pvSettings: ComputedRef<Record<string, unknown>>;
|
|
27
|
+
apSettings: ComputedRef<Record<string, unknown>>;
|
|
27
28
|
};
|
|
@@ -8,11 +8,12 @@ import { PaymentMethodOptionsEmit } from './paymentMethodOptionsTypes';
|
|
|
8
8
|
export declare function useAuthviaPaymentMethodOptions(props: PaymentMethodOptionsProps, emit: PaymentMethodOptionsEmit): {
|
|
9
9
|
defaultCardSubmitBtnText: any;
|
|
10
10
|
defaultAchSubmitBtnText: any;
|
|
11
|
-
cardDemoMode: boolean | undefined
|
|
12
|
-
achDemoMode: boolean | undefined
|
|
13
|
-
achSelectionMode: "default" | "collapse" | undefined
|
|
14
|
-
pzSettings: Record<string, unknown> | undefined
|
|
15
|
-
|
|
11
|
+
cardDemoMode: import('vue').Ref<boolean | undefined, boolean | undefined>;
|
|
12
|
+
achDemoMode: import('vue').Ref<boolean | undefined, boolean | undefined>;
|
|
13
|
+
achSelectionMode: import('vue').Ref<"default" | "collapse" | undefined, "default" | "collapse" | undefined>;
|
|
14
|
+
pzSettings: import('vue').Ref<Record<string, unknown> | undefined, Record<string, unknown> | undefined>;
|
|
15
|
+
apSettings: import('vue').Ref<Record<string, unknown> | undefined, Record<string, unknown> | undefined>;
|
|
16
|
+
vuetifyOverrides: import('vue').Ref<string | undefined, string | undefined>;
|
|
16
17
|
closePaymentMethodForm: () => void;
|
|
17
18
|
handlePaymentMethodClick: (type: string) => void;
|
|
18
19
|
handleAchOptions: () => void;
|
|
@@ -26,6 +27,12 @@ export declare function useAuthviaPaymentMethodOptions(props: PaymentMethodOptio
|
|
|
26
27
|
type?: import('../../model').PaymentMethodType;
|
|
27
28
|
}) => void;
|
|
28
29
|
handlePazeCancel: () => void;
|
|
30
|
+
handleApplePaySuccess: (data: import('./paymentMethodOptionsTypes').PazeSuccessPayload) => void;
|
|
31
|
+
handleApplePayError: (error: {
|
|
32
|
+
message: string;
|
|
33
|
+
type?: import('../../model').PaymentMethodType;
|
|
34
|
+
}) => void;
|
|
35
|
+
handleApplePayCancel: () => void;
|
|
29
36
|
handleCreditCardSuccess: (data: import('./paymentMethodOptionsTypes').MethodSuccessPayload | null) => void;
|
|
30
37
|
handleCreditCardError: (error: {
|
|
31
38
|
message: string;
|
|
@@ -60,6 +67,9 @@ export declare function useAuthviaPaymentMethodOptions(props: PaymentMethodOptio
|
|
|
60
67
|
showACHForm: import('vue').Ref<boolean>;
|
|
61
68
|
showACHOptions: import('vue').Ref<boolean>;
|
|
62
69
|
showPazeForm: import('vue').Ref<boolean>;
|
|
70
|
+
showApplePayInline: import('vue').Ref<boolean>;
|
|
71
|
+
showApplePayQrActive: import('vue').Ref<boolean>;
|
|
72
|
+
applePaySessionInFlight: import('vue').Ref<boolean>;
|
|
63
73
|
showPlaidOption: import('vue').Ref<boolean>;
|
|
64
74
|
showConfirmLoader: import('vue').Ref<boolean>;
|
|
65
75
|
errorMessage: import('vue').Ref<string>;
|
|
@@ -20,6 +20,12 @@ export declare function usePaymentMethodOptionsHandlers(props: PaymentMethodOpti
|
|
|
20
20
|
type?: PaymentMethodType;
|
|
21
21
|
}) => void;
|
|
22
22
|
handlePazeCancel: () => void;
|
|
23
|
+
handleApplePaySuccess: (data: PazeSuccessPayload) => void;
|
|
24
|
+
handleApplePayError: (error: {
|
|
25
|
+
message: string;
|
|
26
|
+
type?: PaymentMethodType;
|
|
27
|
+
}) => void;
|
|
28
|
+
handleApplePayCancel: () => void;
|
|
23
29
|
handleCreditCardSuccess: (data: MethodSuccessPayload | null) => void;
|
|
24
30
|
handleCreditCardError: (error: {
|
|
25
31
|
message: string;
|
|
@@ -13,6 +13,9 @@ export declare function usePaymentMethodOptionsState(props: PaymentMethodOptions
|
|
|
13
13
|
showACHForm: Ref<boolean>;
|
|
14
14
|
showACHOptions: Ref<boolean>;
|
|
15
15
|
showPazeForm: Ref<boolean>;
|
|
16
|
+
showApplePayInline: Ref<boolean>;
|
|
17
|
+
showApplePayQrActive: Ref<boolean>;
|
|
18
|
+
applePaySessionInFlight: Ref<boolean>;
|
|
16
19
|
showPlaidOption: Ref<boolean>;
|
|
17
20
|
showConfirmLoader: Ref<boolean>;
|
|
18
21
|
errorMessage: Ref<string>;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { UsePaymentMethodServiceReturn } from './usePaymentMethodService';
|
|
2
|
+
import { ApplePayAuthorizedPayment } from '../types/applePay';
|
|
3
|
+
import { PaymentMethodSuccessPayload } from '../utils/paymentMethodSuccessPayload';
|
|
4
|
+
export interface CreateApplePayPaymentMethodInput {
|
|
5
|
+
payment: ApplePayAuthorizedPayment | unknown;
|
|
6
|
+
authToken: string;
|
|
7
|
+
merchantId?: string;
|
|
8
|
+
customerRef?: string;
|
|
9
|
+
intent?: string;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Creates an Authvia payment method from Apple Pay `onpaymentauthorized` payload.
|
|
13
|
+
* Passes Apple's token object through unchanged in the POST body.
|
|
14
|
+
*/
|
|
15
|
+
export declare function createApplePayPaymentMethod(input: CreateApplePayPaymentMethodInput, paymentMethodService: UsePaymentMethodServiceReturn): Promise<PaymentMethodSuccessPayload>;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Apple Pay JS SDK loader and session helpers.
|
|
3
|
+
*
|
|
4
|
+
* Types live in `@/types/applePay`; implementation lives under `@/composables/applePay/`.
|
|
5
|
+
*
|
|
6
|
+
* @see https://developer.apple.com/documentation/applepayontheweb
|
|
7
|
+
*/
|
|
8
|
+
export { getApplePayCredentialStatus, shouldShowApplePayButton, } from './applePay/sdkCredentials';
|
|
9
|
+
export { isApplePaySessionDefined, loadApplePaySDK, resetApplePaySDKLoader, } from './applePay/sdkLoader';
|
|
10
|
+
export { createApplePaySession, resolveApplePayApiVersion, } from './applePay/sdkSession';
|
|
11
|
+
export { APPLE_PAY_DEFERRED_API_VERSION, APPLE_PAY_MIN_API_VERSION, APPLE_PAY_PREFERRED_API_VERSION, APPLE_PAY_SESSION_STATUS_FAILURE, APPLE_PAY_SESSION_STATUS_SUCCESS, APPLE_PAY_ZERO_TOTAL_API_VERSION, } from './applePay/sdkTypes';
|
|
12
|
+
export type { ApplePayBillingContactField, ApplePayCapabilitiesResponse, ApplePayCardType, ApplePayCredentialStatus, ApplePayDeferredPaymentRequest, ApplePayLineItem, ApplePayLineItemType, ApplePayPaymentMethodUpdate, ApplePayPaymentRequest, ApplePayRecurringInterval, ApplePayRecurringPaymentRequest, ApplePaySelectedPaymentMethod, ApplePaySessionInstance, ApplePaySessionStatic, } from '../types/applePay';
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Apple Pay session lifecycle. Types live in `@/types/applePay`; implementation lives under
|
|
3
|
+
* `@/composables/applePay/`.
|
|
4
|
+
*/
|
|
5
|
+
export { startApplePaySessionFlow } from './applePay/startApplePaySessionFlow';
|
|
6
|
+
export type { ApplePayPaymentMethodSuccessResult, ApplePaySessionDiagnostics, ApplePaySessionStartCallbacks, ApplePaySessionStartInput, } from '../types/applePay';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export type HostRuntimeConfigKey = 'googleAPIKey' | 'pazeSDKURL' | 'paypalSDKURL' | 'paypalClientId' | 'paypalEnvironment' | 'plaidEnv';
|
|
1
|
+
export type HostRuntimeConfigKey = 'googleAPIKey' | 'pazeSDKURL' | 'paypalSDKURL' | 'applePaySDKURL' | 'paypalClientId' | 'paypalEnvironment' | 'plaidEnv';
|
|
2
2
|
/**
|
|
3
3
|
* Return type for useHostService composable
|
|
4
4
|
* Compatible with original HostService.instance() API
|
|
@@ -11,6 +11,7 @@ export interface UseHostServiceReturn {
|
|
|
11
11
|
pazeSDKURL: string;
|
|
12
12
|
plaidEnv: string;
|
|
13
13
|
paypalSDKURL: string;
|
|
14
|
+
applePaySDKURL: string;
|
|
14
15
|
paypalClientId: string;
|
|
15
16
|
paypalEnvironment: string;
|
|
16
17
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Ref } from 'vue';
|
|
2
2
|
import { PaymentMethod, APIOptions, PaymentMethodFilters, Token, PaymentMethodPermissionRequest, PaymentMethodPermission, PayPalSetupTokenResponse, PayPalIDTokenResponse } from '../model';
|
|
3
3
|
import { useWalletMerchantService } from './useWalletMerchantService';
|
|
4
|
+
import { ApplePayConfig } from '../utils/applePayConfig';
|
|
4
5
|
/**
|
|
5
6
|
* Return type for usePaymentMethodService composable
|
|
6
7
|
*/
|
|
@@ -26,6 +27,10 @@ export interface UsePaymentMethodServiceReturn {
|
|
|
26
27
|
generatePaypalIDToken: (options: APIOptions) => Promise<PayPalIDTokenResponse>;
|
|
27
28
|
getReturnUrl: () => string;
|
|
28
29
|
generatePaypalSetupToken: (options: APIOptions, paymentSourceType: string) => Promise<PayPalSetupTokenResponse>;
|
|
30
|
+
generateApplePaySessionToken: (options: APIOptions, params: {
|
|
31
|
+
applePay?: boolean | ApplePayConfig;
|
|
32
|
+
merchantId?: string;
|
|
33
|
+
}) => Promise<unknown>;
|
|
29
34
|
setPaymentMethodPermission: (userId: string, paymentMethodId: string, options: APIOptions, permissionRequest: PaymentMethodPermissionRequest) => Promise<void>;
|
|
30
35
|
}
|
|
31
36
|
/**
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/** Values returned by `ApplePaySession.applePayCapabilities().paymentCredentialStatus`. */
|
|
2
|
+
export type ApplePayCredentialStatus = 'paymentCredentialsAvailable' | 'paymentCredentialStatusUnknown' | 'paymentCredentialsUnavailable' | 'applePayUnsupported';
|
|
3
|
+
/** How often a recurring stored credential bills. */
|
|
4
|
+
export type ApplePayRecurringInterval = 'year' | 'month' | 'day' | 'hour' | 'minute';
|
|
5
|
+
/** Card category Apple reports on the selected payment method. */
|
|
6
|
+
export type ApplePayCardType = 'debit' | 'credit' | 'prepaid' | 'store';
|
|
7
|
+
export type ApplePayLineItemType = 'final' | 'pending';
|
|
8
|
+
export type ApplePayBillingContactField = 'postalAddress' | 'name' | 'phone' | 'email' | 'phoneticName';
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { ApplePayCardType, ApplePayRecurringInterval } from './common';
|
|
2
|
+
import { ApplePayPaymentRequest } from './sdk';
|
|
3
|
+
export type { ApplePayAuthorizedPayment, ApplePayContact, ApplePayPaymentMethodCreatePayload, ApplePayPaymentToken, } from './payment';
|
|
4
|
+
export type { ApplePayCardType } from './common';
|
|
5
|
+
/**
|
|
6
|
+
* Opts a session into the stored-credential flow ("Design B"). Its presence selects the flow.
|
|
7
|
+
*
|
|
8
|
+
* @see docs/APPLE_PAY_FLOW_DESIGNS.md
|
|
9
|
+
*/
|
|
10
|
+
export interface ApplePayDeferredConfig {
|
|
11
|
+
paymentDescription?: string;
|
|
12
|
+
managementURL?: string;
|
|
13
|
+
amount?: string | number;
|
|
14
|
+
label?: string;
|
|
15
|
+
paymentDate?: string;
|
|
16
|
+
billingAgreement?: string;
|
|
17
|
+
tokenNotificationURL?: string;
|
|
18
|
+
}
|
|
19
|
+
/** Stored-credential flow on a fixed billing interval; mutually exclusive with `deferred`. */
|
|
20
|
+
export interface ApplePayRecurringConfig {
|
|
21
|
+
paymentDescription?: string;
|
|
22
|
+
managementURL?: string;
|
|
23
|
+
amount?: string | number;
|
|
24
|
+
label?: string;
|
|
25
|
+
intervalUnit?: ApplePayRecurringInterval;
|
|
26
|
+
intervalCount?: number;
|
|
27
|
+
startDate?: string;
|
|
28
|
+
endDate?: string;
|
|
29
|
+
billingAgreement?: string;
|
|
30
|
+
tokenNotificationURL?: string;
|
|
31
|
+
}
|
|
32
|
+
export interface ApplePaySurchargeConfig {
|
|
33
|
+
percent?: number;
|
|
34
|
+
fixed?: string | number;
|
|
35
|
+
label?: string;
|
|
36
|
+
appliesTo?: ApplePayCardType[];
|
|
37
|
+
}
|
|
38
|
+
/** Host `applePay` prop when not boolean `true`. */
|
|
39
|
+
export interface ApplePayConfig {
|
|
40
|
+
partnerInternalMerchantIdentifier?: string;
|
|
41
|
+
merchantName?: string;
|
|
42
|
+
domain?: string;
|
|
43
|
+
countryCode?: string;
|
|
44
|
+
currencyCode?: string;
|
|
45
|
+
amount?: string | number;
|
|
46
|
+
supportedNetworks?: string[];
|
|
47
|
+
merchantCapabilities?: string[];
|
|
48
|
+
deferred?: ApplePayDeferredConfig;
|
|
49
|
+
recurring?: ApplePayRecurringConfig;
|
|
50
|
+
acceptedCardTypes?: 'both' | 'credit' | 'debit';
|
|
51
|
+
surcharge?: ApplePaySurchargeConfig;
|
|
52
|
+
}
|
|
53
|
+
/** Response from POST /v3/payment-method-providers/applepay/token. */
|
|
54
|
+
export interface ApplePayMerchantSession {
|
|
55
|
+
epochTimestamp: number;
|
|
56
|
+
expiresAt: number;
|
|
57
|
+
merchantSessionIdentifier: string;
|
|
58
|
+
nonce: string;
|
|
59
|
+
merchantIdentifier: string;
|
|
60
|
+
domainName: string;
|
|
61
|
+
displayName: string;
|
|
62
|
+
signature: string;
|
|
63
|
+
operationalAnalyticsIdentifier: string;
|
|
64
|
+
pspId: string;
|
|
65
|
+
}
|
|
66
|
+
export interface ApplePaySessionTokenRequest {
|
|
67
|
+
merchant: {
|
|
68
|
+
id: string;
|
|
69
|
+
profile: {
|
|
70
|
+
name: string;
|
|
71
|
+
};
|
|
72
|
+
};
|
|
73
|
+
domain: string;
|
|
74
|
+
}
|
|
75
|
+
export interface ApplePaySessionFailureDiagnostics {
|
|
76
|
+
configuredDomain: string;
|
|
77
|
+
pageOrigin?: string;
|
|
78
|
+
merchantSession: Record<string, unknown> | null;
|
|
79
|
+
paymentRequest: Pick<ApplePayPaymentRequest, 'total'>;
|
|
80
|
+
merchantValidationCompleted: boolean;
|
|
81
|
+
paymentAuthorized: boolean;
|
|
82
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Canonical Apple Pay type definitions for host props, SDK session shapes, and session flow I/O.
|
|
3
|
+
*/
|
|
4
|
+
export type { ApplePayAuthorizedPayment, ApplePayContact, ApplePayPaymentMethodCreatePayload, ApplePayPaymentToken, } from './payment';
|
|
5
|
+
export type { ApplePayConfig, ApplePayDeferredConfig, ApplePayMerchantSession, ApplePayRecurringConfig, ApplePaySessionFailureDiagnostics, ApplePaySessionTokenRequest, ApplePaySurchargeConfig, } from './config';
|
|
6
|
+
export type { ApplePayBillingContactField, ApplePayCardType, ApplePayCredentialStatus, ApplePayLineItemType, ApplePayRecurringInterval, } from './common';
|
|
7
|
+
export type { ApplePayCapabilitiesResponse, ApplePayDeferredPaymentRequest, ApplePayLineItem, ApplePayPaymentMethodUpdate, ApplePayPaymentRequest, ApplePayRecurringPaymentRequest, ApplePaySelectedPaymentMethod, ApplePaySessionInstance, ApplePaySessionStatic, } from './sdk';
|
|
8
|
+
export type { ApplePayPaymentMethodSuccessResult, ApplePaySessionDiagnostics, ApplePaySessionStartCallbacks, ApplePaySessionStartInput, } from './session';
|