@paydock/client-sdk 1.144.1-beta → 1.145.0-beta
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 +422 -31
- package/bundles/index.cjs +1972 -532
- package/bundles/index.cjs.d.ts +192 -8
- package/bundles/index.mjs +1972 -532
- package/bundles/index.mjs.d.ts +192 -8
- package/bundles/types/helper/browser.d.ts.map +1 -1
- package/bundles/types/helper/element-id.d.ts +3 -1
- package/bundles/types/helper/element-id.d.ts.map +1 -1
- package/bundles/types/helper/uuid.d.ts.map +1 -1
- package/bundles/types/open-wallets/apple-pay-open-wallet-button.d.ts +41 -0
- package/bundles/types/open-wallets/apple-pay-open-wallet-button.d.ts.map +1 -1
- package/bundles/types/open-wallets/base/open-wallet-buttons.d.ts +10 -0
- package/bundles/types/open-wallets/base/open-wallet-buttons.d.ts.map +1 -1
- package/bundles/types/open-wallets/base/service-config-cache.d.ts +23 -0
- package/bundles/types/open-wallets/base/service-config-cache.d.ts.map +1 -0
- package/bundles/types/open-wallets/google-pay-open-wallet-button.d.ts +33 -1
- package/bundles/types/open-wallets/google-pay-open-wallet-button.d.ts.map +1 -1
- package/bundles/types/open-wallets/index.d.ts +82 -1
- package/bundles/types/open-wallets/index.d.ts.map +1 -1
- package/bundles/types/open-wallets/interfaces/apple-pay/apple-pay-availability.interface.d.ts +41 -0
- package/bundles/types/open-wallets/interfaces/apple-pay/apple-pay-availability.interface.d.ts.map +1 -0
- package/bundles/types/open-wallets/interfaces/apple-pay/index.d.ts +1 -0
- package/bundles/types/open-wallets/interfaces/apple-pay/index.d.ts.map +1 -1
- package/bundles/types/open-wallets/interfaces/google-pay/google-pay-availability.interface.d.ts +25 -0
- package/bundles/types/open-wallets/interfaces/google-pay/google-pay-availability.interface.d.ts.map +1 -0
- package/bundles/types/open-wallets/interfaces/google-pay/index.d.ts +1 -0
- package/bundles/types/open-wallets/interfaces/google-pay/index.d.ts.map +1 -1
- package/bundles/types/open-wallets/interfaces/index.d.ts +3 -0
- package/bundles/types/open-wallets/interfaces/index.d.ts.map +1 -1
- package/bundles/types/open-wallets/interfaces/open-wallet-availability.interface.d.ts +31 -0
- package/bundles/types/open-wallets/interfaces/open-wallet-availability.interface.d.ts.map +1 -0
- package/bundles/types/open-wallets/services/apple-pay/apple-pay-availability.d.ts +58 -0
- package/bundles/types/open-wallets/services/apple-pay/apple-pay-availability.d.ts.map +1 -0
- package/bundles/types/open-wallets/services/apple-pay/apple-pay.open-wallet.service.d.ts +8 -10
- package/bundles/types/open-wallets/services/apple-pay/apple-pay.open-wallet.service.d.ts.map +1 -1
- package/bundles/types/open-wallets/services/apple-pay/index.d.ts +1 -0
- package/bundles/types/open-wallets/services/apple-pay/index.d.ts.map +1 -1
- package/bundles/types/open-wallets/services/google-pay/google-pay-availability.d.ts +53 -0
- package/bundles/types/open-wallets/services/google-pay/google-pay-availability.d.ts.map +1 -0
- package/bundles/types/open-wallets/services/google-pay/google-pay.open-wallet.service.d.ts.map +1 -1
- package/bundles/types/open-wallets/services/google-pay/index.d.ts +1 -0
- package/bundles/types/open-wallets/services/google-pay/index.d.ts.map +1 -1
- package/bundles/widget.umd.js +1972 -532
- package/bundles/widget.umd.js.d.ts +192 -8
- package/bundles/widget.umd.js.min.d.ts +192 -8
- package/bundles/widget.umd.min.js +1 -1
- package/docs/open-wallet-buttons-examples.md +170 -2
- package/docs/open-wallet-buttons.md +252 -29
- package/package.json +10 -7
- package/slate.md +170 -2
|
@@ -1,2 +1,3 @@
|
|
|
1
|
+
export type { ApplePayAvailabilityOptions, ApplePayAvailabilityResult, ApplePayCapabilityToken, ApplePayCredentialStatus, } from './apple-pay-availability.interface';
|
|
1
2
|
export type { ApplePayLineItem, ApplePayMerchantCapability, ApplePayPaymentContact, ApplePayPaymentRequest, } from './apple-pay-payment-request.interface';
|
|
2
3
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/open-wallets/interfaces/apple-pay/index.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,gBAAgB,EAChB,0BAA0B,EAC1B,sBAAsB,EACtB,sBAAsB,GACvB,MAAM,uCAAuC,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/open-wallets/interfaces/apple-pay/index.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,2BAA2B,EAC3B,0BAA0B,EAC1B,uBAAuB,EACvB,wBAAwB,GACzB,MAAM,oCAAoC,CAAC;AAC5C,YAAY,EACV,gBAAgB,EAChB,0BAA0B,EAC1B,sBAAsB,EACtB,sBAAsB,GACvB,MAAM,uCAAuC,CAAC"}
|
package/bundles/types/open-wallets/interfaces/google-pay/google-pay-availability.interface.d.ts
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { OpenWalletAvailabilityOptions, OpenWalletAvailabilityResult } from '../open-wallet-availability.interface';
|
|
2
|
+
/**
|
|
3
|
+
* Options for `GooglePayOpenWalletButton.checkAvailability`. Extends
|
|
4
|
+
* {@link OpenWalletAvailabilityOptions}. All fields are optional — Google Pay's
|
|
5
|
+
* `isReadyToPay` check does not require a merchant identifier. Provide
|
|
6
|
+
* `public_key_or_access_token` + `service_id` to validate that the service is a Google Pay
|
|
7
|
+
* service (and resolve the merchant id), or `merchant_id` directly.
|
|
8
|
+
*/
|
|
9
|
+
export interface GooglePayAvailabilityOptions extends OpenWalletAvailabilityOptions {
|
|
10
|
+
/**
|
|
11
|
+
* Google Pay gateway merchant identifier. Optional — `isReadyToPay` does not require it;
|
|
12
|
+
* when omitted the readiness check still runs.
|
|
13
|
+
*/
|
|
14
|
+
merchant_id?: string;
|
|
15
|
+
}
|
|
16
|
+
/** Result of `GooglePayOpenWalletButton.checkAvailability`. */
|
|
17
|
+
export interface GooglePayAvailabilityResult extends OpenWalletAvailabilityResult {
|
|
18
|
+
/**
|
|
19
|
+
* Google's `isReadyToPay` `paymentMethodPresent` — whether the buyer already has a
|
|
20
|
+
* payment method usable with Google Pay. `undefined` when not reported (e.g. the
|
|
21
|
+
* synchronous check, or browsers where it is not surfaced).
|
|
22
|
+
*/
|
|
23
|
+
payment_method_present?: boolean;
|
|
24
|
+
}
|
|
25
|
+
//# sourceMappingURL=google-pay-availability.interface.d.ts.map
|
package/bundles/types/open-wallets/interfaces/google-pay/google-pay-availability.interface.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"google-pay-availability.interface.d.ts","sourceRoot":"","sources":["../../../../src/open-wallets/interfaces/google-pay/google-pay-availability.interface.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,6BAA6B,EAC7B,4BAA4B,EAC7B,MAAM,uCAAuC,CAAC;AAE/C;;;;;;GAMG;AACH,MAAM,WAAW,4BAA6B,SAAQ,6BAA6B;IACjF;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,+DAA+D;AAC/D,MAAM,WAAW,2BAA4B,SAAQ,4BAA4B;IAC/E;;;;OAIG;IACH,sBAAsB,CAAC,EAAE,OAAO,CAAC;CAClC"}
|
|
@@ -1,2 +1,3 @@
|
|
|
1
|
+
export type { GooglePayAvailabilityOptions, GooglePayAvailabilityResult, } from './google-pay-availability.interface';
|
|
1
2
|
export type { GooglePayAuthMethod, GooglePayCardConfig, GooglePayCardNetwork, GooglePayOpenWalletMeta, GooglePayOpenWalletMetaStyles, } from './google-pay-meta.interface';
|
|
2
3
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/open-wallets/interfaces/google-pay/index.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,mBAAmB,EACnB,mBAAmB,EACnB,oBAAoB,EACpB,uBAAuB,EACvB,6BAA6B,GAC9B,MAAM,6BAA6B,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/open-wallets/interfaces/google-pay/index.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,4BAA4B,EAC5B,2BAA2B,GAC5B,MAAM,qCAAqC,CAAC;AAC7C,YAAY,EACV,mBAAmB,EACnB,mBAAmB,EACnB,oBAAoB,EACpB,uBAAuB,EACvB,6BAA6B,GAC9B,MAAM,6BAA6B,CAAC"}
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
export type { WalletType } from '../types/wallet-type.type';
|
|
2
2
|
export { WALLET_TYPES } from '../types/wallet-type.type';
|
|
3
|
+
export type { ApplePayAvailabilityOptions, ApplePayAvailabilityResult, ApplePayCapabilityToken, ApplePayCredentialStatus, } from './apple-pay/apple-pay-availability.interface';
|
|
3
4
|
export type { OnCancelEventData, OnClickEventData, OnCreateOTTErrorEventData, OnCreateOTTErrorPayload, OnCreateOTTSuccessfulEventData, OnCreateOTTSuccessPayload, OnErrorEventData, OnErrorPayload, OnLoadedEventData, OnUnavailableDetails, OnUnavailableEventData, OnUnavailablePayload, } from './events.interface';
|
|
5
|
+
export type { GooglePayAvailabilityOptions, GooglePayAvailabilityResult, } from './google-pay/google-pay-availability.interface';
|
|
6
|
+
export type { OpenWalletAvailabilityOptions, OpenWalletAvailabilityResult, } from './open-wallet-availability.interface';
|
|
4
7
|
export type { OpenWalletMeta } from './open-wallet-meta.interface';
|
|
5
8
|
export type { IOpenWalletProvider } from './payment-source.interface';
|
|
6
9
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/open-wallets/interfaces/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AAC5D,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACzD,YAAY,EACV,iBAAiB,EACjB,gBAAgB,EAChB,yBAAyB,EACzB,uBAAuB,EACvB,8BAA8B,EAC9B,yBAAyB,EACzB,gBAAgB,EAChB,cAAc,EACd,iBAAiB,EACjB,oBAAoB,EACpB,sBAAsB,EACtB,oBAAoB,GACrB,MAAM,oBAAoB,CAAC;AAC5B,YAAY,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AACnE,YAAY,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/open-wallets/interfaces/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AAC5D,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACzD,YAAY,EACV,2BAA2B,EAC3B,0BAA0B,EAC1B,uBAAuB,EACvB,wBAAwB,GACzB,MAAM,8CAA8C,CAAC;AACtD,YAAY,EACV,iBAAiB,EACjB,gBAAgB,EAChB,yBAAyB,EACzB,uBAAuB,EACvB,8BAA8B,EAC9B,yBAAyB,EACzB,gBAAgB,EAChB,cAAc,EACd,iBAAiB,EACjB,oBAAoB,EACpB,sBAAsB,EACtB,oBAAoB,GACrB,MAAM,oBAAoB,CAAC;AAC5B,YAAY,EACV,4BAA4B,EAC5B,2BAA2B,GAC5B,MAAM,gDAAgD,CAAC;AACxD,YAAY,EACV,6BAA6B,EAC7B,4BAA4B,GAC7B,MAAM,sCAAsC,CAAC;AAC9C,YAAY,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AACnE,YAAY,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Base options shared by every wallet's static availability check
|
|
3
|
+
* (e.g. `ApplePayOpenWalletButton.checkAvailability`). Wallet-specific option
|
|
4
|
+
* interfaces extend this with their own fields.
|
|
5
|
+
*/
|
|
6
|
+
export interface OpenWalletAvailabilityOptions {
|
|
7
|
+
/** Public key or access token used to fetch the service config when needed. */
|
|
8
|
+
public_key_or_access_token?: string;
|
|
9
|
+
/** Service ID — used with `public_key_or_access_token` to resolve the wallet configuration. */
|
|
10
|
+
service_id?: string;
|
|
11
|
+
/** Environment for the config fetch (e.g. `'sandbox'`). Defaults to the SDK default. */
|
|
12
|
+
env?: string;
|
|
13
|
+
/**
|
|
14
|
+
* When `true`, performs only the cheap, network-free synchronous check and resolves
|
|
15
|
+
* immediately — no config fetch, SDK load, or remote capability query.
|
|
16
|
+
*/
|
|
17
|
+
sync?: boolean;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Base result shared by every wallet's static availability check. Wallet-specific
|
|
21
|
+
* result interfaces extend this with their own fields.
|
|
22
|
+
*/
|
|
23
|
+
export interface OpenWalletAvailabilityResult {
|
|
24
|
+
/** Convenience verdict: the wallet is usable for a payment in the current context. */
|
|
25
|
+
available: boolean;
|
|
26
|
+
/** Whether the wallet is supported here at all (may be available via a fallback flow). */
|
|
27
|
+
supported: boolean;
|
|
28
|
+
/** Machine-readable reason when not available. */
|
|
29
|
+
reason?: string;
|
|
30
|
+
}
|
|
31
|
+
//# sourceMappingURL=open-wallet-availability.interface.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"open-wallet-availability.interface.d.ts","sourceRoot":"","sources":["../../../src/open-wallets/interfaces/open-wallet-availability.interface.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,WAAW,6BAA6B;IAC5C,+EAA+E;IAC/E,0BAA0B,CAAC,EAAE,MAAM,CAAC;IACpC,+FAA+F;IAC/F,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,wFAAwF;IACxF,GAAG,CAAC,EAAE,MAAM,CAAC;IACb;;;OAGG;IACH,IAAI,CAAC,EAAE,OAAO,CAAC;CAChB;AAED;;;GAGG;AACH,MAAM,WAAW,4BAA4B;IAC3C,sFAAsF;IACtF,SAAS,EAAE,OAAO,CAAC;IACnB,0FAA0F;IAC1F,SAAS,EAAE,OAAO,CAAC;IACnB,kDAAkD;IAClD,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB"}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
/// <reference types="applepayjs" />
|
|
2
|
+
import type { ApplePayAvailabilityResult, ApplePayCapabilityToken } from '../../interfaces/apple-pay/apple-pay-availability.interface';
|
|
3
|
+
declare global {
|
|
4
|
+
interface Window {
|
|
5
|
+
ApplePaySession: ApplePaySession;
|
|
6
|
+
}
|
|
7
|
+
}
|
|
8
|
+
/** Parameters for {@link evaluateApplePayAvailability}. */
|
|
9
|
+
export interface EvaluateApplePayAvailabilityParams {
|
|
10
|
+
/** Apple merchant identifier required by `ApplePaySession.applePayCapabilities`. */
|
|
11
|
+
merchantId: string;
|
|
12
|
+
/**
|
|
13
|
+
* Statuses that count as available. Defaults to
|
|
14
|
+
* `['credentials_available', 'credentials_status_unknown']` — the `unknown` status
|
|
15
|
+
* is the normal value in third-party / cross-device (QR) browsers, so including it
|
|
16
|
+
* is what makes Apple Pay show up outside Safari.
|
|
17
|
+
*/
|
|
18
|
+
apple_pay_capabilities?: ApplePayCapabilityToken[];
|
|
19
|
+
}
|
|
20
|
+
/** CDN location of Apple's web SDK (provides the `<apple-pay-button>` web component). */
|
|
21
|
+
export declare const APPLE_PAY_SDK_URL = "https://applepay.cdn-apple.com/jsapi/1.latest/apple-pay-sdk.js";
|
|
22
|
+
/**
|
|
23
|
+
* Statuses that count as available when the merchant does not override them.
|
|
24
|
+
* Includes `paymentCredentialStatusUnknown` so the button is shown in third-party /
|
|
25
|
+
* cross-device (QR) browsers, per Apple's guidance.
|
|
26
|
+
*/
|
|
27
|
+
export declare const DEFAULT_APPLE_PAY_CAPABILITIES: ApplePayJS.PaymentCredentialStatus[];
|
|
28
|
+
/**
|
|
29
|
+
* Maps the SDK's friendly capability tokens to Apple's `PaymentCredentialStatus` values.
|
|
30
|
+
* Unknown tokens are passed through unchanged.
|
|
31
|
+
*/
|
|
32
|
+
export declare function formatCapabilities(capabilities: ApplePayCapabilityToken[] | string[]): ApplePayJS.PaymentCredentialStatus[];
|
|
33
|
+
/**
|
|
34
|
+
* Synchronous, network-free check for a **native, same-device** Apple Pay session
|
|
35
|
+
* (`window.ApplePaySession` exists and `canMakePayments()` is `true`). Safe to call in
|
|
36
|
+
* any environment (never throws).
|
|
37
|
+
*
|
|
38
|
+
* Note: this is a legacy/Safari-oriented signal. It is **not** authoritative for
|
|
39
|
+
* cross-browser / cross-device (QR) availability — in Chrome/Edge/Firefox
|
|
40
|
+
* `window.ApplePaySession` is supplied by the CDN SDK and may be absent until it loads,
|
|
41
|
+
* and the cross-device flow is reflected by `applePayCapabilities()`, not this call.
|
|
42
|
+
* Use {@link evaluateApplePayAvailability} for the authoritative, cross-browser answer.
|
|
43
|
+
*/
|
|
44
|
+
export declare function hasNativeApplePaySession(): boolean;
|
|
45
|
+
/**
|
|
46
|
+
* Idempotently loads Apple's web SDK from the CDN.
|
|
47
|
+
* Resolves immediately if the `<apple-pay-button>` custom element is already
|
|
48
|
+
* registered, and de-duplicates concurrent loads. Rejects if the script fails to load.
|
|
49
|
+
*/
|
|
50
|
+
export declare function loadApplePaySdk(): Promise<void>;
|
|
51
|
+
/**
|
|
52
|
+
* Core Apple Pay availability evaluation, shared by the instance flow
|
|
53
|
+
* (`ApplePayOpenWalletService`) and the static `ApplePayOpenWalletButton.checkAvailability`.
|
|
54
|
+
*
|
|
55
|
+
* Assumes the Apple Pay SDK is already loaded (call {@link loadApplePaySdk} first).
|
|
56
|
+
*/
|
|
57
|
+
export declare function evaluateApplePayAvailability(params: EvaluateApplePayAvailabilityParams): Promise<ApplePayAvailabilityResult>;
|
|
58
|
+
//# sourceMappingURL=apple-pay-availability.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"apple-pay-availability.d.ts","sourceRoot":"","sources":["../../../../src/open-wallets/services/apple-pay/apple-pay-availability.ts"],"names":[],"mappings":";AAAA,OAAO,KAAK,EACV,0BAA0B,EAC1B,uBAAuB,EAExB,MAAM,6DAA6D,CAAC;AAErE,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,MAAM;QACd,eAAe,EAAE,eAAe,CAAC;KAClC;CACF;AAED,2DAA2D;AAC3D,MAAM,WAAW,kCAAkC;IACjD,oFAAoF;IACpF,UAAU,EAAE,MAAM,CAAC;IACnB;;;;;OAKG;IACH,sBAAsB,CAAC,EAAE,uBAAuB,EAAE,CAAC;CACpD;AAED,yFAAyF;AACzF,eAAO,MAAM,iBAAiB,mEACoC,CAAC;AAEnE;;;;GAIG;AACH,eAAO,MAAM,8BAA8B,EAAE,UAAU,CAAC,uBAAuB,EAG9E,CAAC;AAEF;;;GAGG;AACH,wBAAgB,kBAAkB,CAChC,YAAY,EAAE,uBAAuB,EAAE,GAAG,MAAM,EAAE,GACjD,UAAU,CAAC,uBAAuB,EAAE,CAUtC;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,wBAAwB,IAAI,OAAO,CAWlD;AAID;;;;GAIG;AACH,wBAAgB,eAAe,IAAI,OAAO,CAAC,IAAI,CAAC,CAwB/C;AAED;;;;;GAKG;AACH,wBAAsB,4BAA4B,CAChD,MAAM,EAAE,kCAAkC,GACzC,OAAO,CAAC,0BAA0B,CAAC,CAsDrC"}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/// <reference types="applepayjs" />
|
|
2
1
|
import type { ApiInternal } from '../../../api/api-internal';
|
|
3
2
|
import { type GetConfigResponse } from '../../../api/api-service-internal';
|
|
4
3
|
import type { Container } from '../../../components/container';
|
|
@@ -9,11 +8,6 @@ import type { OpenWalletMeta } from '../../interfaces';
|
|
|
9
8
|
import type { ApplePayLineItem, ApplePayMerchantCapability, ApplePayPaymentRequest } from '../../interfaces/apple-pay';
|
|
10
9
|
import type { OpenWalletMetaStyles } from '../../interfaces/open-wallet-meta.interface';
|
|
11
10
|
import type { ApplePayButtonStyle, ApplePayButtonType } from '../../types/apple-pay';
|
|
12
|
-
declare global {
|
|
13
|
-
interface Window {
|
|
14
|
-
ApplePaySession: ApplePaySession;
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
11
|
/** Styling configuration for the Apple Pay button. */
|
|
18
12
|
interface ApplePayOpenWalletMetaStyles extends OpenWalletMetaStyles {
|
|
19
13
|
/** Variant displayed on the button (e.g. `'buy'`, `'donate'`, `'plain'`, `'check-out'`). */
|
|
@@ -74,8 +68,14 @@ export interface ApplePayOpenWalletMeta extends OpenWalletMeta, Omit<ApplePayPay
|
|
|
74
68
|
/** Visual styling for the Apple Pay button. */
|
|
75
69
|
style?: ApplePayOpenWalletMetaStyles;
|
|
76
70
|
/**
|
|
77
|
-
* Device
|
|
78
|
-
*
|
|
71
|
+
* Device credential statuses that make the button render. Defaults to
|
|
72
|
+
* `['credentials_available', 'credentials_status_unknown']`:
|
|
73
|
+
* - `credentials_available` — the device has a confirmed Apple Pay card ready to use.
|
|
74
|
+
* - `credentials_status_unknown` — a local card can't be confirmed, but Apple Pay can
|
|
75
|
+
* still proceed (e.g. the cross-device flow where the buyer completes payment on their
|
|
76
|
+
* iPhone via QR, used by Chrome, Edge and Firefox).
|
|
77
|
+
* The button renders when the device's reported status is in this list. Narrow to
|
|
78
|
+
* `['credentials_available']` to require a confirmed local card.
|
|
79
79
|
*/
|
|
80
80
|
apple_pay_capabilities?: Array<'credentials_available' | 'credentials_status_unknown' | 'credentials_unavailable'>;
|
|
81
81
|
}
|
|
@@ -120,7 +120,6 @@ export declare class ApplePayOpenWalletService extends OpenWalletService {
|
|
|
120
120
|
private handleMerchantOnButtonClickEvent;
|
|
121
121
|
private onPaymentAuthorized;
|
|
122
122
|
private formatShippingOptions;
|
|
123
|
-
private formatCapabilities;
|
|
124
123
|
private formatErrorFields;
|
|
125
124
|
private createButtonStyle;
|
|
126
125
|
private onShippingContactUpdated;
|
|
@@ -130,7 +129,6 @@ export declare class ApplePayOpenWalletService extends OpenWalletService {
|
|
|
130
129
|
private parseShippingMethodUpdateEvent;
|
|
131
130
|
private mapContactToApplePayPaymentRequestContact;
|
|
132
131
|
private mapMetaToApplePayPaymentRequest;
|
|
133
|
-
private isUnsuportedBrowser;
|
|
134
132
|
}
|
|
135
133
|
export {};
|
|
136
134
|
//# sourceMappingURL=apple-pay.open-wallet.service.d.ts.map
|
package/bundles/types/open-wallets/services/apple-pay/apple-pay.open-wallet.service.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"apple-pay.open-wallet.service.d.ts","sourceRoot":"","sources":["../../../../src/open-wallets/services/apple-pay/apple-pay.open-wallet.service.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"apple-pay.open-wallet.service.d.ts","sourceRoot":"","sources":["../../../../src/open-wallets/services/apple-pay/apple-pay.open-wallet.service.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAC7D,OAAO,EACL,KAAK,iBAAiB,EAEvB,MAAM,mCAAmC,CAAC;AAE3C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,+BAA+B,CAAC;AAC/D,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AACzE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAClE,OAAO,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAC;AAGnE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AACvD,OAAO,KAAK,EACV,gBAAgB,EAChB,0BAA0B,EAE1B,sBAAsB,EACvB,MAAM,4BAA4B,CAAC;AACpC,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,6CAA6C,CAAC;AAExF,OAAO,KAAK,EAAE,mBAAmB,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAarF,sDAAsD;AACtD,UAAU,4BAA6B,SAAQ,oBAAoB;IACjE,4FAA4F;IAC5F,WAAW,CAAC,EAAE,kBAAkB,CAAC;IACjC,gEAAgE;IAChE,YAAY,CAAC,EAA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,EAAE,SAAS,EACZ,IAAI,EAAE,sBAAsB,EAC5B,aAAa,EAAE,iBAAiB;IAcnC,OAAO,CAAC,IAAI,EAAE,sBAAsB,GAAG,IAAI;IAKlD,OAAO,CAAC,SAAS;IAwDjB,OAAO,CAAC,aAAa;IAIrB,OAAO,CAAC,aAAa;IAUrB,OAAO,CAAC,kBAAkB;IAI1B,OAAO,CAAC,kBAAkB;IAIb,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;IAelC,OAAO,CAAC,cAAc;YAuBR,iBAAiB;IAQ/B,OAAO,CAAC,KAAK;IAoBb,OAAO,CAAC,uBAAuB;IAuC/B,OAAO,CAAC,eAAe,CAIrB;IAEF,OAAO,CAAC,kBAAkB;IAqB1B,OAAO,CAAC,kBAAkB,CAcxB;YAEY,gCAAgC;IAW9C,OAAO,CAAC,mBAAmB,CAgDzB;IAEF,OAAO,CAAC,qBAAqB,CAQvB;IAEN,OAAO,CAAC,iBAAiB;IA2BzB,OAAO,CAAC,iBAAiB;IAYzB,OAAO,CAAC,wBAAwB,CAmD9B;IAEF,OAAO,CAAC,+BAA+B;IAuBvC,OAAO,CAAC,mBAAmB;IAW3B,OAAO,CAAC,uBAAuB,CA+C7B;IAEF,OAAO,CAAC,8BAA8B;IAWtC,OAAO,CAAC,yCAAyC;IA2BjD,OAAO,CAAC,+BAA+B;CAqExC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/open-wallets/services/apple-pay/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,sBAAsB,EACtB,yBAAyB,GAC1B,MAAM,iCAAiC,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/open-wallets/services/apple-pay/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,sBAAsB,EACtB,yBAAyB,GAC1B,MAAM,iCAAiC,CAAC;AACzC,OAAO,EACL,4BAA4B,EAC5B,wBAAwB,EACxB,eAAe,GAChB,MAAM,0BAA0B,CAAC"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/// <reference types="googlepay" />
|
|
2
|
+
import type { GooglePayAvailabilityResult } from '../../interfaces/google-pay/google-pay-availability.interface';
|
|
3
|
+
declare global {
|
|
4
|
+
interface Window {
|
|
5
|
+
google: typeof google;
|
|
6
|
+
}
|
|
7
|
+
}
|
|
8
|
+
/** Parameters for {@link evaluateGooglePayAvailability}. */
|
|
9
|
+
export interface EvaluateGooglePayAvailabilityParams {
|
|
10
|
+
/** Google Pay gateway merchant identifier (optional — not required by `isReadyToPay`). */
|
|
11
|
+
merchantId?: string;
|
|
12
|
+
/**
|
|
13
|
+
* Pre-built `PaymentsClient` to reuse instead of constructing a fresh one. The button
|
|
14
|
+
* instance passes its already-configured client so the readiness check runs against
|
|
15
|
+
* exactly the same client it will pay with. Omitted by the static check.
|
|
16
|
+
*/
|
|
17
|
+
paymentsClient?: google.payments.api.PaymentsClient;
|
|
18
|
+
/**
|
|
19
|
+
* `isReadyToPay` request to use instead of the default-card-config request. The button
|
|
20
|
+
* instance passes its own request so the check honours the merchant's `card_config`;
|
|
21
|
+
* the static check omits it and uses {@link buildIsReadyToPayRequest}.
|
|
22
|
+
*/
|
|
23
|
+
request?: google.payments.api.IsReadyToPayRequest;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Synchronous, network-free check for whether the Google Pay JS API is already present
|
|
27
|
+
* in the page (`window.google.payments.api.PaymentsClient`). Safe to call in any
|
|
28
|
+
* environment (never throws).
|
|
29
|
+
*
|
|
30
|
+
* Note: Google Pay has no synchronous device/card capability API — this only reports
|
|
31
|
+
* whether the SDK script has loaded. The authoritative readiness signal comes from
|
|
32
|
+
* {@link evaluateGooglePayAvailability} (which runs `isReadyToPay`).
|
|
33
|
+
*/
|
|
34
|
+
export declare function isGooglePayApiPresent(): boolean;
|
|
35
|
+
/**
|
|
36
|
+
* Idempotently loads the Google Pay JS SDK from the CDN.
|
|
37
|
+
* Resolves immediately if the API is already present, de-duplicates concurrent loads,
|
|
38
|
+
* and rejects if the script fails to load.
|
|
39
|
+
*/
|
|
40
|
+
export declare function loadGooglePayScript(): Promise<void>;
|
|
41
|
+
/**
|
|
42
|
+
* Core Google Pay availability evaluation, shared by the instance flow
|
|
43
|
+
* (`GooglePayOpenWalletService`) and the static `GooglePayOpenWalletButton.checkAvailability`.
|
|
44
|
+
*
|
|
45
|
+
* The static check passes no `request`, so it uses the **default** card configuration
|
|
46
|
+
* (a button instance with a custom `card_config` may produce a different result). The
|
|
47
|
+
* instance flow passes its own `paymentsClient` and `request` so the readiness check
|
|
48
|
+
* honours the merchant's `card_config` and runs against the same client it pays with.
|
|
49
|
+
*
|
|
50
|
+
* Assumes the Google Pay SDK is already loaded (call {@link loadGooglePayScript} first).
|
|
51
|
+
*/
|
|
52
|
+
export declare function evaluateGooglePayAvailability(params?: EvaluateGooglePayAvailabilityParams): Promise<GooglePayAvailabilityResult>;
|
|
53
|
+
//# sourceMappingURL=google-pay-availability.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"google-pay-availability.d.ts","sourceRoot":"","sources":["../../../../src/open-wallets/services/google-pay/google-pay-availability.ts"],"names":[],"mappings":";AACA,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,+DAA+D,CAAC;AAYjH,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,MAAM;QACd,MAAM,EAAE,OAAO,MAAM,CAAC;KACvB;CACF;AAED,4DAA4D;AAC5D,MAAM,WAAW,mCAAmC;IAClD,0FAA0F;IAC1F,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;;;OAIG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC,QAAQ,CAAC,GAAG,CAAC,cAAc,CAAC;IACpD;;;;OAIG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC,QAAQ,CAAC,GAAG,CAAC,mBAAmB,CAAC;CACnD;AAED;;;;;;;;GAQG;AACH,wBAAgB,qBAAqB,IAAI,OAAO,CAQ/C;AAID;;;;GAIG;AACH,wBAAgB,mBAAmB,IAAI,OAAO,CAAC,IAAI,CAAC,CA+BnD;AA0BD;;;;;;;;;;GAUG;AACH,wBAAsB,6BAA6B,CACjD,MAAM,GAAE,mCAAwC,GAC/C,OAAO,CAAC,2BAA2B,CAAC,CA8BtC"}
|
package/bundles/types/open-wallets/services/google-pay/google-pay.open-wallet.service.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"google-pay.open-wallet.service.d.ts","sourceRoot":"","sources":["../../../../src/open-wallets/services/google-pay/google-pay.open-wallet.service.ts"],"names":[],"mappings":";AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAC7D,OAAO,EACL,KAAK,iBAAiB,EAEvB,MAAM,mCAAmC,CAAC;AAC3C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,+BAA+B,CAAC;AAG/D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAClE,OAAO,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAC;AAGnE,OAAO,KAAK,EAIV,uBAAuB,EAExB,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"google-pay.open-wallet.service.d.ts","sourceRoot":"","sources":["../../../../src/open-wallets/services/google-pay/google-pay.open-wallet.service.ts"],"names":[],"mappings":";AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAC7D,OAAO,EACL,KAAK,iBAAiB,EAEvB,MAAM,mCAAmC,CAAC;AAC3C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,+BAA+B,CAAC;AAG/D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAClE,OAAO,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAC;AAGnE,OAA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,CAAC,aAAa;IAUrB,OAAO,CAAC,kBAAkB;IAI1B,OAAO,CAAC,kBAAkB;IAI1B,OAAO,CAAC,MAAM;CAoEf"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/open-wallets/services/google-pay/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,0BAA0B,EAAE,MAAM,kCAAkC,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/open-wallets/services/google-pay/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,0BAA0B,EAAE,MAAM,kCAAkC,CAAC;AAC9E,OAAO,EACL,6BAA6B,EAC7B,qBAAqB,EACrB,mBAAmB,GACpB,MAAM,2BAA2B,CAAC"}
|