@authvia/payment-method-create 1.0.18 → 2.0.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.
Files changed (52) hide show
  1. package/dist/components/AuthviaPaymentMethodForm.vue.d.ts +5 -4
  2. package/dist/components/internal/AuthviaApplePayForm.vue.d.ts +31 -0
  3. package/dist/components/internal/AuthviaPaymentMethodAddAch.vue.d.ts +2 -2
  4. package/dist/components/internal/AuthviaPaymentMethodAddPayoutsPayPal.vue.d.ts +2 -2
  5. package/dist/components/internal/AuthviaPaymentMethodCreditCard.vue.d.ts +2 -2
  6. package/dist/components/internal/AuthviaPaymentMethodOptions.vue.d.ts +67 -13
  7. package/dist/components/internal/AuthviaPazeForm.vue.d.ts +2 -2
  8. package/dist/composables/applePay/attachApplePaySessionHandlers.d.ts +15 -0
  9. package/dist/composables/applePay/sdkCredentials.d.ts +10 -0
  10. package/dist/composables/applePay/sdkLoader.d.ts +11 -0
  11. package/dist/composables/applePay/sdkSession.d.ts +13 -0
  12. package/dist/composables/applePay/sdkTypes.d.ts +22 -0
  13. package/dist/composables/applePay/sessionErrorMessages.d.ts +4 -0
  14. package/dist/composables/applePay/sessionPaymentRequest.d.ts +15 -0
  15. package/dist/composables/applePay/sessionStartTypes.d.ts +2 -0
  16. package/dist/composables/applePay/startApplePaySessionFlow.d.ts +6 -0
  17. package/dist/composables/paymentMethodForm/useAuthviaPaymentMethodForm.d.ts +1 -0
  18. package/dist/composables/paymentMethodForm/usePaymentMethodFormChildProps.d.ts +1 -0
  19. package/dist/composables/paymentMethodOptions/useAuthviaPaymentMethodOptions.d.ts +15 -5
  20. package/dist/composables/paymentMethodOptions/usePaymentMethodOptionsHandlers.d.ts +6 -0
  21. package/dist/composables/paymentMethodOptions/usePaymentMethodOptionsState.d.ts +3 -0
  22. package/dist/composables/useApplePayPaymentMethodCreate.d.ts +15 -0
  23. package/dist/composables/useApplePaySDK.d.ts +12 -0
  24. package/dist/composables/useApplePaySessionStart.d.ts +6 -0
  25. package/dist/composables/useHostService.d.ts +2 -1
  26. package/dist/composables/usePaymentMethodService.d.ts +5 -0
  27. package/dist/model/PaymentMethod.d.ts +2 -1
  28. package/dist/types/applePay/common.d.ts +8 -0
  29. package/dist/types/applePay/config.d.ts +82 -0
  30. package/dist/types/applePay/index.d.ts +8 -0
  31. package/dist/types/applePay/payment.d.ts +38 -0
  32. package/dist/types/applePay/sdk.d.ts +93 -0
  33. package/dist/types/applePay/session.d.ts +30 -0
  34. package/dist/types/index.d.ts +10 -1
  35. package/dist/types/paymentMethodOptions.d.ts +2 -0
  36. package/dist/utils/applePay/constants.d.ts +9 -0
  37. package/dist/utils/applePay/deferredFlow.d.ts +18 -0
  38. package/dist/utils/applePay/device.d.ts +9 -0
  39. package/dist/utils/applePay/diagnostics.d.ts +12 -0
  40. package/dist/utils/applePay/paymentPayload.d.ts +14 -0
  41. package/dist/utils/applePay/propAccess.d.ts +23 -0
  42. package/dist/utils/applePay/recurringFlow.d.ts +20 -0
  43. package/dist/utils/applePay/sessionToken.d.ts +5 -0
  44. package/dist/utils/applePay/strings.d.ts +3 -0
  45. package/dist/utils/applePay/surcharge.d.ts +33 -0
  46. package/dist/utils/applePay/types.d.ts +2 -0
  47. package/dist/utils/applePayConfig.d.ts +14 -0
  48. package/dist/utils/applePaySdkConfig.d.ts +14 -0
  49. package/dist/utils/runtimeConfig.d.ts +1 -0
  50. package/dist/vue-plugin.js +2 -2
  51. package/dist/vue-plugin.umd.cjs +2 -2
  52. package/package.json +27 -17
@@ -0,0 +1,38 @@
1
+ import { ApplePayCardType } from './common';
2
+ /** Apple `ApplePayPaymentContact` as received on `billingContact`. */
3
+ export interface ApplePayContact {
4
+ phoneNumber?: string;
5
+ emailAddress?: string;
6
+ givenName?: string;
7
+ familyName?: string;
8
+ phoneticGivenName?: string;
9
+ phoneticFamilyName?: string;
10
+ addressLines?: string[];
11
+ subLocality?: string;
12
+ locality?: string;
13
+ postalCode?: string;
14
+ subAdministrativeArea?: string;
15
+ administrativeArea?: string;
16
+ country?: string;
17
+ countryCode?: string;
18
+ }
19
+ export interface ApplePayPaymentToken {
20
+ paymentData?: unknown;
21
+ paymentMethod?: {
22
+ displayName?: string;
23
+ network?: string;
24
+ type?: ApplePayCardType;
25
+ };
26
+ transactionIdentifier?: string;
27
+ }
28
+ /** Payload from Apple `onpaymentauthorized`. */
29
+ export interface ApplePayAuthorizedPayment {
30
+ token?: ApplePayPaymentToken;
31
+ billingContact?: ApplePayContact;
32
+ shippingContact?: unknown;
33
+ }
34
+ export interface ApplePayPaymentMethodCreatePayload {
35
+ type: 'ApplePay';
36
+ token: NonNullable<ApplePayAuthorizedPayment['token']>;
37
+ address?: ApplePayContact;
38
+ }
@@ -0,0 +1,93 @@
1
+ import { ApplePayBillingContactField, ApplePayCardType, ApplePayCredentialStatus, ApplePayLineItemType, ApplePayRecurringInterval } from './common';
2
+ import { ApplePayAuthorizedPayment } from './payment';
3
+ export type { ApplePayBillingContactField, ApplePayCardType, ApplePayCredentialStatus, ApplePayLineItemType, ApplePayRecurringInterval, } from './common';
4
+ export interface ApplePayCapabilitiesResponse {
5
+ paymentCredentialStatus?: ApplePayCredentialStatus;
6
+ }
7
+ /** A line item as Apple renders it on the sheet. `pending` hides the amount and shows "Pending". */
8
+ export interface ApplePayLineItem {
9
+ label: string;
10
+ amount: string;
11
+ type?: ApplePayLineItemType;
12
+ paymentTiming?: 'immediate' | 'recurring' | 'deferred' | 'automaticReload';
13
+ deferredPaymentDate?: Date;
14
+ recurringPaymentStartDate?: Date;
15
+ recurringPaymentEndDate?: Date;
16
+ recurringPaymentIntervalUnit?: ApplePayRecurringInterval;
17
+ recurringPaymentIntervalCount?: number;
18
+ }
19
+ /** Declares a future charge; makes Apple issue a merchant token (MPAN). Requires version 14. */
20
+ export interface ApplePayDeferredPaymentRequest {
21
+ paymentDescription: string;
22
+ managementURL: string;
23
+ deferredBilling: ApplePayLineItem;
24
+ billingAgreement?: string;
25
+ tokenNotificationURL?: string;
26
+ freeCancellationDate?: Date;
27
+ freeCancellationDateTimeZone?: string;
28
+ }
29
+ /** Declares fixed-interval billing; mutually exclusive with `deferredPaymentRequest`. */
30
+ export interface ApplePayRecurringPaymentRequest {
31
+ paymentDescription: string;
32
+ managementURL: string;
33
+ regularBilling: ApplePayLineItem;
34
+ trialBilling?: ApplePayLineItem;
35
+ billingAgreement?: string;
36
+ tokenNotificationURL?: string;
37
+ }
38
+ /** Minimal Apple Pay payment request; Apple requires a total even when only saving a card. */
39
+ export interface ApplePayPaymentRequest {
40
+ countryCode: string;
41
+ currencyCode: string;
42
+ merchantCapabilities: string[];
43
+ supportedNetworks: string[];
44
+ total: {
45
+ label: string;
46
+ amount: string;
47
+ type?: ApplePayLineItemType;
48
+ };
49
+ lineItems?: ApplePayLineItem[];
50
+ requiredBillingContactFields?: ApplePayBillingContactField[];
51
+ deferredPaymentRequest?: ApplePayDeferredPaymentRequest;
52
+ recurringPaymentRequest?: ApplePayRecurringPaymentRequest;
53
+ }
54
+ /** The card the person selected on the sheet. `type` is what surcharge rules key off. */
55
+ export interface ApplePaySelectedPaymentMethod {
56
+ displayName?: string;
57
+ network?: string;
58
+ type?: ApplePayCardType;
59
+ }
60
+ /** Revised totals handed back from `onpaymentmethodselected`. */
61
+ export interface ApplePayPaymentMethodUpdate {
62
+ newTotal: {
63
+ label: string;
64
+ amount: string;
65
+ type?: ApplePayLineItemType;
66
+ };
67
+ newLineItems?: ApplePayLineItem[];
68
+ }
69
+ export interface ApplePaySessionInstance {
70
+ onvalidatemerchant: ((event: {
71
+ validationURL: string;
72
+ }) => void) | null;
73
+ onpaymentauthorized: ((event: {
74
+ payment: ApplePayAuthorizedPayment;
75
+ }) => void) | null;
76
+ onpaymentmethodselected: ((event: {
77
+ paymentMethod: ApplePaySelectedPaymentMethod;
78
+ }) => void) | null;
79
+ oncancel: ((event?: unknown) => void) | null;
80
+ begin: () => void;
81
+ abort: () => void;
82
+ completeMerchantValidation: (merchantSession: unknown) => void;
83
+ completePaymentMethodSelection: (update: ApplePayPaymentMethodUpdate) => void;
84
+ completePayment: (result: {
85
+ status: number;
86
+ }) => void;
87
+ }
88
+ export interface ApplePaySessionStatic {
89
+ new (version: number, request: ApplePayPaymentRequest): ApplePaySessionInstance;
90
+ canMakePayments?: () => boolean;
91
+ applePayCapabilities?: (merchantIdentifier: string) => Promise<ApplePayCapabilitiesResponse>;
92
+ supportsVersion?: (version: number) => boolean;
93
+ }
@@ -0,0 +1,30 @@
1
+ import { ApplePayConfig } from './config';
2
+ import { ApplePayAuthorizedPayment } from './payment';
3
+ import { ApplePayPaymentRequest } from './sdk';
4
+ import { PaymentMethodErrorPayload } from '..';
5
+ /** Saved payment method id returned after a successful Apple Pay authorization. */
6
+ export type ApplePayPaymentMethodSuccessResult = string | {
7
+ id: string;
8
+ forgetCard?: boolean;
9
+ };
10
+ export interface ApplePaySessionStartInput {
11
+ applePay?: boolean | ApplePayConfig;
12
+ merchantId?: string;
13
+ token?: string;
14
+ fetchMerchantSession?: () => Promise<unknown>;
15
+ submitApplePayPaymentMethod?: (payment: ApplePayAuthorizedPayment) => Promise<ApplePayPaymentMethodSuccessResult>;
16
+ }
17
+ export interface ApplePaySessionStartCallbacks {
18
+ onSuccess: (paymentMethodId: ApplePayPaymentMethodSuccessResult) => void;
19
+ onError: (error: PaymentMethodErrorPayload) => void;
20
+ onCancel: () => void;
21
+ }
22
+ export interface ApplePaySessionDiagnostics {
23
+ configuredDomain: string;
24
+ pageOrigin: string | undefined;
25
+ merchantSession: Record<string, unknown> | null;
26
+ paymentRequest: ApplePayPaymentRequest;
27
+ merchantValidationCompleted: boolean;
28
+ paymentAuthorized: boolean;
29
+ authorizedTotal?: string;
30
+ }
@@ -1,6 +1,7 @@
1
1
  import { PaymentMethodType } from '../model';
2
+ import { ApplePayConfig } from './applePay';
2
3
  /**
3
- * Runtime error from a specific payment method flow (card, ACH, Paze, PayPal, Venmo).
4
+ * Runtime error from a specific payment method flow (card, ACH, Paze, PayPal, Venmo, Apple Pay).
4
5
  * Inner components attach `type` so hosts can branch without parsing `message`.
5
6
  */
6
7
  export interface PaymentMethodFlowError {
@@ -32,6 +33,7 @@ export interface PaymentMethodDisplayConfigMap {
32
33
  paypal?: PaymentMethodDisplayText;
33
34
  paze?: PaymentMethodDisplayText;
34
35
  venmo?: PaymentMethodDisplayText;
36
+ applePay?: PaymentMethodDisplayText;
35
37
  }
36
38
  /** Keys under `paymentMethodDisplay` that configure a single method (excludes list-level `gap`). */
37
39
  export type PaymentMethodDisplayRowKey = Exclude<keyof PaymentMethodDisplayConfigMap, 'gap'>;
@@ -112,6 +114,11 @@ export interface AuthviaPaymentMethodFormProps {
112
114
  profileId?: string;
113
115
  name?: string;
114
116
  };
117
+ /**
118
+ * `true`, or `{ partnerInternalMerchantIdentifier, countryCode?, currencyCode?, amount? }`.
119
+ * `partnerInternalMerchantIdentifier` (or form `merchantId`) is required to open the Apple Pay sheet.
120
+ */
121
+ applePay?: boolean | ApplePayConfig;
115
122
  intent?: string;
116
123
  customerRef?: string;
117
124
  variant?: VuetifyProps['variant'];
@@ -279,6 +286,8 @@ export interface AuthviaPaymentMethodFormPluginOptions {
279
286
  pazeSDKURL: string;
280
287
  plaidEnv: string;
281
288
  paypalSDKURL: string;
289
+ /** Apple Pay JS SDK script URL; falls back to `VITE_APPLE_PAY_SDK_URL` then Apple's CDN. */
290
+ applePaySDKURL?: string;
282
291
  paypalClientId: string;
283
292
  paypalEnvironment?: string;
284
293
  }
@@ -26,6 +26,8 @@ export interface PaymentMethodOptionsProps {
26
26
  achBillingAddress?: PaymentMethodBillingAddress;
27
27
  pzSettings?: Record<string, unknown>;
28
28
  pvSettings?: Record<string, unknown>;
29
+ /** Apple Pay config (`partnerInternalMerchantIdentifier`, `countryCode`, `currencyCode`, `amount`). */
30
+ apSettings?: Record<string, unknown>;
29
31
  forgetHidden?: boolean;
30
32
  forgetDefault?: boolean;
31
33
  color?: string;
@@ -0,0 +1,9 @@
1
+ /** Card networks Apple accepts on the payment sheet when the host does not override them. */
2
+ export declare const DEFAULT_APPLE_PAY_SUPPORTED_NETWORKS: readonly string[];
3
+ /**
4
+ * Default merchant capabilities. Only `supports3DS` is listed: naming `supportsCredit` or
5
+ * `supportsDebit` alone excludes the other card type from the sheet.
6
+ */
7
+ export declare const DEFAULT_APPLE_PAY_MERCHANT_CAPABILITIES: readonly string[];
8
+ export declare const APPLE_PAY_RECURRING_INTERVALS: readonly string[];
9
+ export declare const MERCHANT_SESSION_KEYS: readonly string[];
@@ -0,0 +1,18 @@
1
+ import { ApplePayDeferredPaymentRequest } from '../../types/applePay/sdk';
2
+ import { ApplePayConfig } from './types';
3
+ /** True when the host asked for the stored-credential flow by supplying a `deferred` block. */
4
+ export declare function isApplePayDeferredRequested(applePay: boolean | ApplePayConfig | undefined): boolean;
5
+ /**
6
+ * Validates the `deferred` block against what Apple marks required.
7
+ *
8
+ * @param applePay - The `applePay` prop
9
+ * @returns A host-facing message describing the first problem, or `null` when valid
10
+ */
11
+ export declare function validateApplePayDeferredConfig(applePay: boolean | ApplePayConfig | undefined): string | null;
12
+ /**
13
+ * Builds Apple's `deferredPaymentRequest` from the `deferred` block.
14
+ *
15
+ * @param applePay - The `applePay` prop
16
+ * @returns The request block, or `null` when the host did not ask for this flow
17
+ */
18
+ export declare function buildApplePayDeferredPaymentRequest(applePay: boolean | ApplePayConfig | undefined): ApplePayDeferredPaymentRequest | null;
@@ -0,0 +1,9 @@
1
+ /** True on iPhone/iPad where the native Apple Pay sheet should be used. */
2
+ export declare function isIOSApplePayDevice(): boolean;
3
+ /** True when the browser is Safari (not Chrome/Edge/Firefox shells that also report Safari). */
4
+ export declare function isSafariBrowser(): boolean;
5
+ /**
6
+ * Non-iOS browsers such as desktop Chrome open Apple's scan-with-iPhone QR immediately
7
+ * instead of showing a separate Apple Pay button screen.
8
+ */
9
+ export declare function shouldAutoStartApplePayQr(): boolean;
@@ -0,0 +1,12 @@
1
+ import { ApplePaySessionFailureDiagnostics } from './types';
2
+ /** Safe summary of Apple `oncancel` event (sessionError code/info when provided). */
3
+ export declare function summarizeApplePayCancelEvent(...args: unknown[]): Record<string, unknown>;
4
+ /** Non-sensitive merchant session fields useful when cancel has no Apple error payload. */
5
+ export declare function summarizeApplePayMerchantSessionForLog(session: unknown): Record<string, unknown> | null;
6
+ /**
7
+ * Best-effort diagnosis when Apple cancels after validation (Chrome QR gives no sessionError).
8
+ * Returns human-readable findings for logs and UI.
9
+ */
10
+ export declare function diagnoseApplePaySessionFailure(diagnostics: ApplePaySessionFailureDiagnostics): string[];
11
+ /** User-facing message when authorization fails after successful merchant validation. */
12
+ export declare function buildApplePayAuthorizationFailureMessage(diagnostics: ApplePaySessionFailureDiagnostics, fallbackMessage: string): string;
@@ -0,0 +1,14 @@
1
+ import { ApplePayAuthorizedPayment, ApplePayContact, ApplePayPaymentMethodCreatePayload } from './types';
2
+ /** Token object from Apple `onpaymentauthorized` → POST .../payment-methods body. */
3
+ export declare function extractApplePayTokenForCreate(payment: unknown): NonNullable<ApplePayAuthorizedPayment['token']> | null;
4
+ /**
5
+ * Apple's `billingContact` exactly as received, or `null` when Apple sent nothing.
6
+ *
7
+ * Returning `null` for an empty object keeps the key out of the create body instead of
8
+ * posting `{}`.
9
+ */
10
+ export declare function extractApplePayBillingContact(payment: unknown): ApplePayContact | null;
11
+ /** Builds POST /v3/users/{userId}/payment-methods body from Apple authorization. */
12
+ export declare function buildApplePayPaymentMethodCreatePayload(payment: unknown): ApplePayPaymentMethodCreatePayload | null;
13
+ /** Safe fields for logs; omit encrypted paymentData unless dev logging is enabled separately. */
14
+ export declare function summarizeApplePayAuthorizedPayment(payment: unknown): Record<string, unknown>;
@@ -0,0 +1,23 @@
1
+ import { ApplePayConfig } from './types';
2
+ /** Returns true when the host enabled Apple Pay via `applePay: true` or a config object. */
3
+ export declare function isApplePayPropEnabled(applePay: boolean | ApplePayConfig | undefined): boolean;
4
+ /** Normalizes the `applePay` prop to a config object. */
5
+ export declare function toApplePayConfig(applePay: boolean | ApplePayConfig | undefined): ApplePayConfig;
6
+ /**
7
+ * Authvia partner merchant ref from the `applePay` prop, or `fallbackMerchantId` when omitted.
8
+ * Used for backend merchant-validation and payment-method APIs (not Apple's merchant.com ID).
9
+ */
10
+ export declare function getApplePayPartnerInternalMerchantIdentifier(applePay: boolean | ApplePayConfig | undefined, fallbackMerchantId?: string): string;
11
+ /** Domain registered with Apple for merchant validation; defaults to the page hostname. */
12
+ export declare function getApplePayDomain(applePay: boolean | ApplePayConfig | undefined): string;
13
+ /** Card networks for the Apple Pay payment request; host override or {@link DEFAULT_APPLE_PAY_SUPPORTED_NETWORKS}. */
14
+ export declare function getApplePaySupportedNetworks(applePay: boolean | ApplePayConfig | undefined): string[];
15
+ /**
16
+ * Merchant capabilities for the Apple Pay payment request.
17
+ *
18
+ * An explicit `merchantCapabilities` list always wins - it is the escape hatch for anything this
19
+ * helper does not model, such as `supportsEMV` for China Union Pay. Otherwise `acceptedCardTypes`
20
+ * composes the list: naming `supportsCredit` or `supportsDebit` alone makes Apple grey out the
21
+ * other category on the sheet, while naming both or neither allows both.
22
+ */
23
+ export declare function getApplePayMerchantCapabilities(applePay: boolean | ApplePayConfig | undefined): string[];
@@ -0,0 +1,20 @@
1
+ import { ApplePayRecurringPaymentRequest } from '../../types/applePay/sdk';
2
+ import { ApplePayConfig } from './types';
3
+ /** True when the host asked for the recurring stored-credential flow. */
4
+ export declare function isApplePayRecurringRequested(applePay: boolean | ApplePayConfig | undefined): boolean;
5
+ /** True when either stored-credential flow was requested. */
6
+ export declare function isApplePayStoredCredentialRequested(applePay: boolean | ApplePayConfig | undefined): boolean;
7
+ /**
8
+ * Validates the `recurring` block, and that only one stored-credential flow was requested.
9
+ *
10
+ * @param applePay - The `applePay` prop
11
+ * @returns A host-facing message describing the first problem, or `null` when valid
12
+ */
13
+ export declare function validateApplePayRecurringConfig(applePay: boolean | ApplePayConfig | undefined): string | null;
14
+ /**
15
+ * Builds Apple's `recurringPaymentRequest` from the `recurring` block.
16
+ *
17
+ * @param applePay - The `applePay` prop
18
+ * @returns The request block, or `null` when the host did not ask for this flow
19
+ */
20
+ export declare function buildApplePayRecurringPaymentRequest(applePay: boolean | ApplePayConfig | undefined): ApplePayRecurringPaymentRequest | null;
@@ -0,0 +1,5 @@
1
+ import { ApplePayConfig, ApplePaySessionTokenRequest } from './types';
2
+ /** Builds the Apple Pay session token request from form props. */
3
+ export declare function buildApplePaySessionTokenRequest(applePay: boolean | ApplePayConfig | undefined, merchantId: string | undefined): ApplePaySessionTokenRequest | null;
4
+ /** Normalizes Authvia API responses to the object passed to completeMerchantValidation(). */
5
+ export declare function extractApplePayMerchantSession(body: unknown): unknown;
@@ -0,0 +1,3 @@
1
+ /** Trims optional strings used across Apple Pay config builders. */
2
+ export declare function trimmed(value: string | undefined): string;
3
+ export declare function normalizeApplePayStringList(values: string[] | undefined, fallback: readonly string[]): string[];
@@ -0,0 +1,33 @@
1
+ import { ApplePayPaymentMethodUpdate, ApplePaySelectedPaymentMethod } from '../../types/applePay/sdk';
2
+ import { ApplePayCardType, ApplePayConfig } from './types';
3
+ /** True when the host configured a surcharge that could change the total. */
4
+ export declare function isApplePaySurchargeConfigured(applePay: boolean | ApplePayConfig | undefined): boolean;
5
+ /** Money is handled in integer cents throughout; floats lose pennies at some values. */
6
+ export declare function toApplePayCents(amount: string | number | undefined): number;
7
+ /** Formats cents back to Apple's required `-?[0-9]+(\.[0-9][0-9])?`. */
8
+ export declare function fromApplePayCents(cents: number): string;
9
+ /**
10
+ * Surcharge in cents for the selected card, or 0 when none applies.
11
+ *
12
+ * @param applePay - The `applePay` prop
13
+ * @param baseCents - The pre-surcharge total, in cents
14
+ * @param cardType - `type` from the selected payment method; may be absent
15
+ * @returns Surcharge in cents
16
+ */
17
+ export declare function resolveApplePaySurchargeCents(applePay: boolean | ApplePayConfig | undefined, baseCents: number, cardType: ApplePayCardType | undefined): number;
18
+ /**
19
+ * Revised totals to hand to `completePaymentMethodSelection` when a card is selected.
20
+ *
21
+ * Apple requires a response within 30 seconds, so this is pure and synchronous - no lookups.
22
+ *
23
+ * @param applePay - The `applePay` prop
24
+ * @param baseAmount - The pre-surcharge total
25
+ * @param totalLabel - Label for the total row (the merchant's statement name)
26
+ * @param paymentMethod - The card the person selected
27
+ * @returns The update, and the surcharged total for the host to reconcile against
28
+ */
29
+ export declare function buildApplePayPaymentMethodUpdate(applePay: boolean | ApplePayConfig | undefined, baseAmount: string, totalLabel: string, paymentMethod: ApplePaySelectedPaymentMethod | undefined): {
30
+ update: ApplePayPaymentMethodUpdate;
31
+ totalAmount: string;
32
+ surchargeAmount: string;
33
+ };
@@ -0,0 +1,2 @@
1
+ /** @deprecated Import from `@/types/applePay` instead. Re-exported for internal utils modules. */
2
+ export type { ApplePayAuthorizedPayment, ApplePayConfig, ApplePayContact, ApplePayDeferredConfig, ApplePayMerchantSession, ApplePayPaymentMethodCreatePayload, ApplePayPaymentToken, ApplePayRecurringConfig, ApplePaySessionFailureDiagnostics, ApplePaySessionTokenRequest, ApplePaySurchargeConfig, ApplePayCardType, } from '../../types/applePay';
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Apple Pay configuration helpers. Types live in `@/types/applePay`; this module re-exports
3
+ * the public API so existing `@/utils/applePayConfig` imports stay stable.
4
+ */
5
+ export { DEFAULT_APPLE_PAY_MERCHANT_CAPABILITIES, DEFAULT_APPLE_PAY_SUPPORTED_NETWORKS, } from './applePay/constants';
6
+ export type { ApplePayAuthorizedPayment, ApplePayCardType, ApplePayConfig, ApplePayContact, ApplePayDeferredConfig, ApplePayMerchantSession, ApplePayPaymentMethodCreatePayload, ApplePayPaymentToken, ApplePayRecurringConfig, ApplePaySessionFailureDiagnostics, ApplePaySessionTokenRequest, ApplePaySurchargeConfig, } from '../types/applePay';
7
+ export { buildApplePayDeferredPaymentRequest, isApplePayDeferredRequested, validateApplePayDeferredConfig, } from './applePay/deferredFlow';
8
+ export { buildApplePayAuthorizationFailureMessage, diagnoseApplePaySessionFailure, summarizeApplePayCancelEvent, summarizeApplePayMerchantSessionForLog, } from './applePay/diagnostics';
9
+ export { isIOSApplePayDevice, isSafariBrowser, shouldAutoStartApplePayQr, } from './applePay/device';
10
+ export { buildApplePayPaymentMethodCreatePayload, extractApplePayBillingContact, extractApplePayTokenForCreate, summarizeApplePayAuthorizedPayment, } from './applePay/paymentPayload';
11
+ export { getApplePayDomain, getApplePayMerchantCapabilities, getApplePayPartnerInternalMerchantIdentifier, getApplePaySupportedNetworks, isApplePayPropEnabled, toApplePayConfig, } from './applePay/propAccess';
12
+ export { buildApplePayRecurringPaymentRequest, isApplePayRecurringRequested, isApplePayStoredCredentialRequested, validateApplePayRecurringConfig, } from './applePay/recurringFlow';
13
+ export { buildApplePaySessionTokenRequest, extractApplePayMerchantSession, } from './applePay/sessionToken';
14
+ export { buildApplePayPaymentMethodUpdate, fromApplePayCents, isApplePaySurchargeConfigured, resolveApplePaySurchargeCents, toApplePayCents, } from './applePay/surcharge';
@@ -0,0 +1,14 @@
1
+ /** Apple's CDN when `VITE_APPLE_PAY_SDK_URL` and host `applePaySDKURL` are unset. */
2
+ export declare const DEFAULT_APPLE_PAY_SDK_URL: string;
3
+ /** Apple Pay JS SDK script URL from host config or `VITE_APPLE_PAY_SDK_URL`. */
4
+ export declare function getApplePaySdkUrlFromEnv(): string;
5
+ /** Resolved Apple Pay SDK script URL; falls back to {@link DEFAULT_APPLE_PAY_SDK_URL}. */
6
+ export declare function getApplePaySdkUrl(): string;
7
+ /** Lowest Apple Pay JS API version this component will use. Override with `VITE_APPLE_PAY_MIN_API_VERSION`. */
8
+ export declare function getApplePayMinApiVersion(): number;
9
+ /** First version allowing a zero total. Override with `VITE_APPLE_PAY_ZERO_TOTAL_API_VERSION`. */
10
+ export declare function getApplePayZeroTotalApiVersion(): number;
11
+ /** Preferred session version for charge-now flows. Override with `VITE_APPLE_PAY_PREFERRED_API_VERSION`. */
12
+ export declare function getApplePayPreferredApiVersion(): number;
13
+ /** Version for deferred/recurring flows. Override with `VITE_APPLE_PAY_DEFERRED_API_VERSION`. */
14
+ export declare function getApplePayDeferredApiVersion(): number;
@@ -2,5 +2,6 @@ export declare function resolvePaypalClientId(): string;
2
2
  export declare function resolveGoogleMapsApiKey(): string;
3
3
  export declare function resolvePaypalSdkUrl(): string;
4
4
  export declare function resolvePazeSdkUrl(): string;
5
+ export declare function resolveApplePaySdkUrl(): string;
5
6
  export declare function resolvePaypalEnvironment(): string;
6
7
  export declare function resolvePlaidEnv(): string;