@paydock/client-sdk 1.144.0-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 +2476 -988
- package/bundles/index.cjs.d.ts +627 -431
- package/bundles/index.mjs +2476 -988
- package/bundles/index.mjs.d.ts +627 -431
- package/bundles/types/api/api-base.d.ts +15 -2
- package/bundles/types/api/api-base.d.ts.map +1 -1
- 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/types/secure-remote-commerce/secure-remote-commerce.d.ts.map +1 -1
- package/bundles/widget.umd.js +2476 -988
- package/bundles/widget.umd.js.d.ts +627 -431
- package/bundles/widget.umd.js.min.d.ts +627 -431
- 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 +15 -8
- package/slate.md +170 -2
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { Env } from '../configs/env';
|
|
2
1
|
import { Observable } from 'rxjs';
|
|
2
|
+
import { Env } from '../configs/env';
|
|
3
|
+
import { type ErrorCause } from '../helper/event-error';
|
|
3
4
|
import { type HttpRequestMethod } from '../shared/http/http-request';
|
|
4
5
|
import { type ReportErrorFn, type ReportEventFn } from '../shared/services/instrumentation/repositories';
|
|
5
6
|
export declare enum API_AUTH_TYPE {
|
|
@@ -38,10 +39,22 @@ export declare class ApiBase {
|
|
|
38
39
|
text: string;
|
|
39
40
|
status: number;
|
|
40
41
|
}, cb: any, errorCb: any): any;
|
|
41
|
-
parserPromise<Res>({ text, status
|
|
42
|
+
parserPromise<Res>({ text, status }: {
|
|
42
43
|
text: string;
|
|
43
44
|
status: number;
|
|
44
45
|
}): Promise<Res>;
|
|
46
|
+
/**
|
|
47
|
+
* Wires the XHR failure events that `onload` does not cover. `onload` only
|
|
48
|
+
* fires when an HTTP response is received (any status, including 4xx/5xx);
|
|
49
|
+
* transport-level failures — a dropped connection, a failed CORS preflight,
|
|
50
|
+
* an HTTP/2 protocol error, or a timeout — fire `onerror`/`ontimeout`/
|
|
51
|
+
* `onabort` instead. Without these the request never settles and fails
|
|
52
|
+
* silently (e.g. `onUnavailable` is never invoked for wallet callbacks).
|
|
53
|
+
*/
|
|
54
|
+
protected attachFailureHandlers(request: XMLHttpRequest, onFailure: (error: {
|
|
55
|
+
message: string;
|
|
56
|
+
code: ErrorCause;
|
|
57
|
+
}) => void): void;
|
|
45
58
|
reportEvent: ReportEventFn;
|
|
46
59
|
reportError: ReportErrorFn;
|
|
47
60
|
protected newApiRequest(method: Extract<HttpRequestMethod, 'GET' | 'POST'>, link: string): XMLHttpRequest;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api-base.d.ts","sourceRoot":"","sources":["../../src/api/api-base.ts"],"names":[],"mappings":"AAAA,OAAO,EAAW,GAAG,EAAE,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"api-base.d.ts","sourceRoot":"","sources":["../../src/api/api-base.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAmB,MAAM,MAAM,CAAC;AACnD,OAAO,EAAW,GAAG,EAAE,MAAM,gBAAgB,CAAC;AAG9C,OAAO,EAAe,KAAK,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QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,EAAE,EAAE,KAAA,EAAE,OAAO,KAAA;IAkBtE,aAAa,CAAC,GAAG,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,GAAG,CAAC;IAkBpF;;;;;;;OAOG;IACH,SAAS,CAAC,qBAAqB,CAC7B,OAAO,EAAE,cAAc,EACvB,SAAS,EAAE,CAAC,KAAK,EAAE;QAAE,OAAO,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,UAAU,CAAA;KAAE,KAAK,IAAI;IAmBnE,WAAW,EAAE,aAAa,CAExB;IAEF,WAAW,EAAE,aAAa,CAExB;IAEF,SAAS,CAAC,aAAa,CACrB,MAAM,EAAE,OAAO,CAAC,iBAAiB,EAAE,KAAK,GAAG,MAAM,CAAC,EAClD,IAAI,EAAE,MAAM;IAoBd,IAAW,GAAG;;;;MAMb;CACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"browser.d.ts","sourceRoot":"","sources":["../../src/helper/browser.ts"],"names":[],"mappings":"AAAA,qBAAa,OAAO;WACJ,UAAU,IAAI,OAAO;WAQrB,WAAW,IAAI,OAAO;WAQtB,cAAc,IAAI,OAAO;WAIzB,WAAW,IAAI,MAAM;WAIrB,iBAAiB,IAAI,MAAM;WAI3B,cAAc,IAAI,MAAM;
|
|
1
|
+
{"version":3,"file":"browser.d.ts","sourceRoot":"","sources":["../../src/helper/browser.ts"],"names":[],"mappings":"AAAA,qBAAa,OAAO;WACJ,UAAU,IAAI,OAAO;WAQrB,WAAW,IAAI,OAAO;WAQtB,cAAc,IAAI,OAAO;WAIzB,WAAW,IAAI,MAAM;WAIrB,iBAAiB,IAAI,MAAM;WAI3B,cAAc,IAAI,MAAM;WAkCxB,aAAa,IAAI,OAAO;WAIxB,YAAY,IAAI,MAAM;WAItB,aAAa,IAAI,MAAM;WAIvB,eAAe,IAAI,MAAM;WAIzB,cAAc,IAAI,MAAM;WAIxB,cAAc,IAAI;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE;CAgClE"}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Generate a unique id compatible with HTML element id
|
|
2
|
+
* Generate a unique id compatible with HTML element id.
|
|
3
|
+
* Uses the Web Crypto API for cryptographically strong randomness, with a
|
|
4
|
+
* deterministic fallback only when crypto is unavailable.
|
|
3
5
|
*/
|
|
4
6
|
export declare function getUniqueId(): string;
|
|
5
7
|
//# sourceMappingURL=element-id.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"element-id.d.ts","sourceRoot":"","sources":["../../src/helper/element-id.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"element-id.d.ts","sourceRoot":"","sources":["../../src/helper/element-id.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,wBAAgB,WAAW,WAkB1B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"uuid.d.ts","sourceRoot":"","sources":["../../src/helper/uuid.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"uuid.d.ts","sourceRoot":"","sources":["../../src/helper/uuid.ts"],"names":[],"mappings":"AAAA,qBAAa,IAAI;WACD,QAAQ;IAwCtB,OAAO,CAAC,MAAM,CAAC,IAAI;IAQnB,OAAO,CAAC,MAAM,CAAC,MAAM;CAatB"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { type GetConfigResponse } from '../api/api-service-internal';
|
|
2
2
|
import type { OpenWalletService } from './base/open-wallet.service';
|
|
3
3
|
import { OpenWalletButtons } from './base/open-wallet-buttons';
|
|
4
|
+
import type { ApplePayAvailabilityOptions, ApplePayAvailabilityResult } from './interfaces/apple-pay/apple-pay-availability.interface';
|
|
4
5
|
import type { ApplePayOpenWalletMeta } from './services/apple-pay';
|
|
5
6
|
import type { WalletType } from './types';
|
|
6
7
|
/**
|
|
@@ -41,6 +42,46 @@ import type { WalletType } from './types';
|
|
|
41
42
|
export declare class ApplePayOpenWalletButton extends OpenWalletButtons<ApplePayOpenWalletMeta> {
|
|
42
43
|
/** @private */
|
|
43
44
|
readonly walletType: WalletType;
|
|
45
|
+
/**
|
|
46
|
+
* Checks Apple Pay availability **without instantiating the button** — the single,
|
|
47
|
+
* authoritative, cross-browser-aware availability entry point.
|
|
48
|
+
*
|
|
49
|
+
* Resolves the merchant identifier (either supplied directly or fetched from the
|
|
50
|
+
* service configuration), loads Apple's web SDK if needed, then queries
|
|
51
|
+
* `ApplePaySession.applePayCapabilities()`. Returns a convenience `available` verdict
|
|
52
|
+
* (computed against `apple_pay_capabilities`), the raw device-reported
|
|
53
|
+
* `payment_credential_status`, and `has_native_session` so callers can infer the transport:
|
|
54
|
+
* `available && has_native_session` ⇒ native sheet likely; `available && !has_native_session`
|
|
55
|
+
* ⇒ cross-device / QR handoff likely.
|
|
56
|
+
*
|
|
57
|
+
* Pass `{ sync: true }` for a cheap, network-free native same-device pre-check that
|
|
58
|
+
* resolves immediately (see {@link ApplePayAvailabilityOptions.sync}).
|
|
59
|
+
*
|
|
60
|
+
* @param {ApplePayAvailabilityOptions} [options] - Merchant context, allowed capabilities, and mode.
|
|
61
|
+
* @returns {Promise<ApplePayAvailabilityResult>} The availability result.
|
|
62
|
+
*
|
|
63
|
+
* @example
|
|
64
|
+
* // Lightest path — no network, when you already know the merchant identifier:
|
|
65
|
+
* const result = await ApplePayOpenWalletButton.checkAvailability({ merchant_id });
|
|
66
|
+
*
|
|
67
|
+
* @example
|
|
68
|
+
* // Resolve the merchant identifier from the service configuration:
|
|
69
|
+
* const result = await ApplePayOpenWalletButton.checkAvailability({
|
|
70
|
+
* public_key_or_access_token,
|
|
71
|
+
* service_id,
|
|
72
|
+
* env: 'sandbox',
|
|
73
|
+
* });
|
|
74
|
+
* if (result.available) {
|
|
75
|
+
* // Render the Apple Pay button (native sheet or cross-device QR, per has_native_session).
|
|
76
|
+
* } else {
|
|
77
|
+
* console.log('Unavailable:', result.reason, result.payment_credential_status);
|
|
78
|
+
* }
|
|
79
|
+
*
|
|
80
|
+
* @example
|
|
81
|
+
* // Synchronous native-only fast check (no network / SDK load):
|
|
82
|
+
* const { has_native_session } = await ApplePayOpenWalletButton.checkAvailability({ sync: true });
|
|
83
|
+
*/
|
|
84
|
+
static checkAvailability(options?: ApplePayAvailabilityOptions): Promise<ApplePayAvailabilityResult>;
|
|
44
85
|
/**
|
|
45
86
|
* Validates Apple Pay-specific required metadata fields.
|
|
46
87
|
* Apple Pay requires `amount_label` and `store_name` to be present and strings.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"apple-pay-open-wallet-button.d.ts","sourceRoot":"","sources":["../../src/open-wallets/apple-pay-open-wallet-button.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"apple-pay-open-wallet-button.d.ts","sourceRoot":"","sources":["../../src/open-wallets/apple-pay-open-wallet-button.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,iBAAiB,EAAiB,MAAM,6BAA6B,CAAC;AAEpF,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AACpE,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAE/D,OAAO,KAAK,EACV,2BAA2B,EAC3B,0BAA0B,EAC3B,MAAM,yDAAyD,CAAC;AACjE,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,sBAAsB,CAAC;AAOnE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAG1C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AACH,qBAAa,wBAAyB,SAAQ,iBAAiB,CAAC,sBAAsB,CAAC;IACrF,eAAe;IACf,SAAgB,UAAU,EAAE,UAAU,CAA0B;IAEhE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAsCG;WACiB,iBAAiB,CACnC,OAAO,GAAE,2BAAgC,GACxC,OAAO,CAAC,0BAA0B,CAAC;IA+EtC;;;;;;;OAOG;IACH,SAAS,CAAC,kBAAkB,IAAI,IAAI;IAmBpC;;;;;;OAMG;IACH,SAAS,CAAC,mBAAmB,CAAC,aAAa,EAAE,iBAAiB,GAAG,IAAI;IASrE;;;;;;OAMG;IACH,SAAS,CAAC,mBAAmB,CAAC,aAAa,EAAE,iBAAiB,GAAG,iBAAiB;CAUnF"}
|
|
@@ -38,6 +38,16 @@ export declare abstract class OpenWalletButtons<TMeta extends OpenWalletMeta = O
|
|
|
38
38
|
abstract readonly walletType: WalletType;
|
|
39
39
|
/** @private */
|
|
40
40
|
constructor(selector: string, publicKeyOrAccessToken: string, serviceId: string, meta: TMeta);
|
|
41
|
+
/**
|
|
42
|
+
* Invalidates the cached service configuration whenever an error or unavailable
|
|
43
|
+
* event fires, so the next `load()` re-fetches a fresh config. The cache is keyed
|
|
44
|
+
* on the service ID with a 1-day TTL; clearing it on failure means a config that
|
|
45
|
+
* changed server-side (and caused the failure) is not reused until the TTL expires.
|
|
46
|
+
* Registered once per button, independently of any merchant-registered handlers.
|
|
47
|
+
*
|
|
48
|
+
* @private
|
|
49
|
+
*/
|
|
50
|
+
private registerCacheInvalidationOnError;
|
|
41
51
|
/**
|
|
42
52
|
* Creates the wallet-specific service instance for this button.
|
|
43
53
|
* Each concrete subclass implements this to instantiate its specific wallet service.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"open-wallet-buttons.d.ts","sourceRoot":"","sources":["../../../src/open-wallets/base/open-wallet-buttons.ts"],"names":[],"mappings":"AAAA,OAAO,EAAiB,WAAW,EAAE,MAAM,wBAAwB,CAAC;AACpE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAC;AACxE,OAAO,EAAE,SAAS,EAAE,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AAG,IAAI;IAkB/E;;;;;OAKG;IACH;;;;;;;;;;;;;;OAcG;IACI,QAAQ,CAAC,OAAO,EAAE,CAAC,IAAI,EAAE,iBAAiB,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI;IAqBjF;;;;;;;;;;;;;OAaG;IACI,QAAQ,CAAC,OAAO,EAAE,CAAC,IAAI,EAAE,iBAAiB,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI;IAkBjF;;;;;;OAMG;IACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAkCG;IACI,uBAAuB,CAC5B,OAAO,EAAE,CACP,IAAI,EAAE,gCAAgC,KAEpC,oCAAoC,GACpC,OAAO,CAAC,oCAAoC,CAAC;IAYnD;;;;;;OAMG;IACH;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA4BG;IACI,uBAAuB,CAC5B,OAAO,EAAE,CACP,IAAI,EAAE,+BAA+B,KAEnC,mCAAmC,GACnC,OAAO,CAAC,mCAAmC,CAAC;IAalD;;;;;;OAMG;IACH,IAAW,wCAAwC,IAAI,OAAO,CAE7D;CACF"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { ApiInternal } from '../../api/api-internal';
|
|
2
|
+
import type { GetConfigResponse } from '../../api/api-service-internal';
|
|
3
|
+
/**
|
|
4
|
+
* Removes the cached service configuration for the given service ID, forcing the next
|
|
5
|
+
* fetch to go to the network. Called on error / unavailable flows so a potentially
|
|
6
|
+
* stale cached config is not reused after something changed server-side. No-throw when
|
|
7
|
+
* `localStorage` is unavailable.
|
|
8
|
+
*
|
|
9
|
+
* @param serviceId - The service ID whose cached configuration should be cleared.
|
|
10
|
+
*/
|
|
11
|
+
export declare function clearServiceConfigCache(serviceId: string): void;
|
|
12
|
+
/**
|
|
13
|
+
* Fetches the wallet service configuration, backed by a 1-day `localStorage` cache
|
|
14
|
+
* keyed on the service ID. Falls back gracefully (no caching) when `localStorage`
|
|
15
|
+
* is unavailable (e.g. private browsing). Shared by the instance `load()` flow and
|
|
16
|
+
* the static availability checks so both reuse the same cached fetch.
|
|
17
|
+
*
|
|
18
|
+
* @param api - The configured API client (env must already be set).
|
|
19
|
+
* @param serviceId - The service ID to fetch the configuration for.
|
|
20
|
+
* @returns The service configuration response.
|
|
21
|
+
*/
|
|
22
|
+
export declare function getServiceConfigCached(api: ApiInternal, serviceId: string): Promise<GetConfigResponse>;
|
|
23
|
+
//# sourceMappingURL=service-config-cache.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"service-config-cache.d.ts","sourceRoot":"","sources":["../../../src/open-wallets/base/service-config-cache.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAC1D,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAC;AAUxE;;;;;;;GAOG;AACH,wBAAgB,uBAAuB,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI,CAM/D;AAED;;;;;;;;;GASG;AACH,wBAAsB,sBAAsB,CAC1C,GAAG,EAAE,WAAW,EAChB,SAAS,EAAE,MAAM,GAChB,OAAO,CAAC,iBAAiB,CAAC,CAkC5B"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { type GetConfigResponse } from '../api/api-service-internal';
|
|
2
2
|
import type { OpenWalletService } from './base/open-wallet.service';
|
|
3
3
|
import { OpenWalletButtons } from './base/open-wallet-buttons';
|
|
4
|
-
import type { GooglePayOpenWalletMeta } from './interfaces/google-pay';
|
|
4
|
+
import type { GooglePayAvailabilityOptions, GooglePayAvailabilityResult, GooglePayOpenWalletMeta } from './interfaces/google-pay';
|
|
5
5
|
import type { WalletType } from './types';
|
|
6
6
|
/**
|
|
7
7
|
* @classdesc Google Pay wallet button that creates One-Time Tokens (OTT) via Google Pay.
|
|
@@ -39,6 +39,38 @@ import type { WalletType } from './types';
|
|
|
39
39
|
export declare class GooglePayOpenWalletButton extends OpenWalletButtons<GooglePayOpenWalletMeta> {
|
|
40
40
|
/** @private */
|
|
41
41
|
readonly walletType: WalletType;
|
|
42
|
+
/**
|
|
43
|
+
* Checks Google Pay availability **without instantiating the button** — the static
|
|
44
|
+
* availability entry point.
|
|
45
|
+
*
|
|
46
|
+
* Loads the Google Pay JS SDK if needed, then runs `PaymentsClient.isReadyToPay()` using
|
|
47
|
+
* the **default** card configuration (a button instance with a custom `card_config` may
|
|
48
|
+
* produce a different result). All options are optional — unlike Apple Pay, Google Pay's
|
|
49
|
+
* readiness check does not require a merchant identifier; supplying `service_id` +
|
|
50
|
+
* `public_key_or_access_token` additionally validates that the service is a Google Pay service.
|
|
51
|
+
*
|
|
52
|
+
* Pass `{ sync: true }` for a cheap, network-free check that only reports whether the
|
|
53
|
+
* Google Pay JS API is already present (see {@link GooglePayAvailabilityOptions.sync}).
|
|
54
|
+
*
|
|
55
|
+
* @param {GooglePayAvailabilityOptions} [options] - Optional merchant context and mode.
|
|
56
|
+
* @returns {Promise<GooglePayAvailabilityResult>} The availability result.
|
|
57
|
+
*
|
|
58
|
+
* @example
|
|
59
|
+
* // Simplest form — no merchant context needed:
|
|
60
|
+
* const result = await GooglePayOpenWalletButton.checkAvailability();
|
|
61
|
+
* if (result.available) {
|
|
62
|
+
* // Render the Google Pay button.
|
|
63
|
+
* }
|
|
64
|
+
*
|
|
65
|
+
* @example
|
|
66
|
+
* // Validate the service is a Google Pay service while checking:
|
|
67
|
+
* const result = await GooglePayOpenWalletButton.checkAvailability({
|
|
68
|
+
* public_key_or_access_token,
|
|
69
|
+
* service_id,
|
|
70
|
+
* env: 'sandbox',
|
|
71
|
+
* });
|
|
72
|
+
*/
|
|
73
|
+
static checkAvailability(options?: GooglePayAvailabilityOptions): Promise<GooglePayAvailabilityResult>;
|
|
42
74
|
/**
|
|
43
75
|
* Validates Google Pay-specific required metadata fields.
|
|
44
76
|
* Google Pay has no additional required fields beyond the base (amount, currency, country).
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"google-pay-open-wallet-button.d.ts","sourceRoot":"","sources":["../../src/open-wallets/google-pay-open-wallet-button.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"google-pay-open-wallet-button.d.ts","sourceRoot":"","sources":["../../src/open-wallets/google-pay-open-wallet-button.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,iBAAiB,EAAiB,MAAM,6BAA6B,CAAC;AAEpF,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AACpE,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAE/D,OAAO,KAAK,EACV,4BAA4B,EAC5B,2BAA2B,EAC3B,uBAAuB,EACxB,MAAM,yBAAyB,CAAC;AAOjC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAG1C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH,qBAAa,yBAA0B,SAAQ,iBAAiB,CAAC,uBAAuB,CAAC;IACvF,eAAe;IACf,SAAgB,UAAU,EAAE,UAAU,CAA2B;IAEjE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA8BG;WACiB,iBAAiB,CACnC,OAAO,GAAE,4BAAiC,GACzC,OAAO,CAAC,2BAA2B,CAAC;IAqDvC;;;;OAIG;IACH,SAAS,CAAC,kBAAkB,IAAI,IAAI;IAMpC;;;;;;OAMG;IACH,SAAS,CAAC,mBAAmB,CAAC,aAAa,EAAE,iBAAiB,GAAG,IAAI;IASrE;;;;;;OAMG;IACH,SAAS,CAAC,mBAAmB,CAAC,aAAa,EAAE,iBAAiB,GAAG,iBAAiB;CAUnF"}
|
|
@@ -26,7 +26,7 @@ export { WALLET_TYPES } from './types/wallet-type.type';
|
|
|
26
26
|
* @param {IApplePayShippingOption[]} [shipping_options] - Array of available shipping options. The first item is used as the default selected option. Requires `request_shipping` to be `true`.
|
|
27
27
|
* @param {boolean} [show_billing_address] - Show billing address fields in the Apple Pay sheet.
|
|
28
28
|
* @param {string} store_name - The merchant's store name displayed during payment.
|
|
29
|
-
* @param {Array<'credentials_available' | 'credentials_status_unknown' | 'credentials_unavailable'>} [apple_pay_capabilities] - Device
|
|
29
|
+
* @param {Array<'credentials_available' | 'credentials_status_unknown' | 'credentials_unavailable'>} [apple_pay_capabilities] - Device credential statuses that make the button render. Defaults to `['credentials_available', 'credentials_status_unknown']`: `credentials_available` means the device has a confirmed Apple Pay card ready to use; `credentials_status_unknown` means a local card can't be confirmed but Apple Pay can still proceed (e.g. the cross-device QR flow used by Chrome, Edge and Firefox). Narrow to `['credentials_available']` to require a confirmed local card.
|
|
30
30
|
* @param {Array<'supports3DS' | 'supportsEMV' | 'supportsCredit' | 'supportsDebit'>} [merchant_capabilities] - Array of merchant capabilities influencing the transaction processing features available.
|
|
31
31
|
* @param {Array<'visa' | 'masterCard' | 'amex' | 'chinaUnionPay' | 'discover' | 'interac' | 'jcb' | 'privateLabel'>} [supported_networks] - List of payment networks supported for Apple Pay transactions.
|
|
32
32
|
* @param {Array<'email' | 'name' | 'phone' | 'postalAddress'>} [required_billing_contact_fields] - Contact fields required from the user for billing purposes. Phone and email are currently not returned by Apple.
|
|
@@ -57,6 +57,87 @@ export { WALLET_TYPES } from './types/wallet-type.type';
|
|
|
57
57
|
* @param {GooglePayButtonColor} [style.button_color] - The color of the Google Pay button (`'default'`, `'black'`, `'white'`).
|
|
58
58
|
* @param {GooglePayButtonSizeMode} [style.button_size_mode] - The size mode (`'static'`, `'fill'`).
|
|
59
59
|
**/
|
|
60
|
+
/**
|
|
61
|
+
* Base options shared by every wallet's static availability check
|
|
62
|
+
* (e.g. {@link ApplePayOpenWalletButton}.checkAvailability). Wallet-specific option
|
|
63
|
+
* interfaces (such as {@link ApplePayAvailabilityOptions}) extend this.
|
|
64
|
+
*
|
|
65
|
+
* @interface OpenWalletAvailabilityOptions
|
|
66
|
+
*
|
|
67
|
+
* @type {object}
|
|
68
|
+
* @param {string} [public_key_or_access_token] - Public key or access token used to fetch the service config when needed.
|
|
69
|
+
* @param {string} [service_id] - Service ID — used with `public_key_or_access_token` to resolve the wallet configuration.
|
|
70
|
+
* @param {string} [env] - Environment for the config fetch (e.g. `'sandbox'`). Defaults to the SDK default.
|
|
71
|
+
* @param {boolean} [sync] - When `true`, performs only the cheap, network-free synchronous check and resolves immediately — no config fetch, SDK load, or remote capability query.
|
|
72
|
+
**/
|
|
73
|
+
/**
|
|
74
|
+
* Base result shared by every wallet's static availability check. Wallet-specific
|
|
75
|
+
* result interfaces (such as {@link ApplePayAvailabilityResult}) extend this.
|
|
76
|
+
*
|
|
77
|
+
* @interface OpenWalletAvailabilityResult
|
|
78
|
+
*
|
|
79
|
+
* @type {object}
|
|
80
|
+
* @param {boolean} available - Convenience verdict: the wallet is usable for a payment in the current context.
|
|
81
|
+
* @param {boolean} supported - Whether the wallet is supported here at all (may be available via a fallback flow).
|
|
82
|
+
* @param {string} [reason] - Machine-readable reason when not available.
|
|
83
|
+
**/
|
|
84
|
+
/**
|
|
85
|
+
* Options for `ApplePayOpenWalletButton.checkAvailability`. Extends
|
|
86
|
+
* {@link OpenWalletAvailabilityOptions}. Provide `merchant_id` directly to skip the network
|
|
87
|
+
* call, **or** provide `public_key_or_access_token` + `service_id` to resolve the merchant
|
|
88
|
+
* identifier from the service configuration.
|
|
89
|
+
*
|
|
90
|
+
* @interface ApplePayAvailabilityOptions
|
|
91
|
+
* @extends OpenWalletAvailabilityOptions
|
|
92
|
+
*
|
|
93
|
+
* @type {object}
|
|
94
|
+
* @param {string} [merchant_id] - Apple merchant identifier. Provide this OR (`public_key_or_access_token` + `service_id`).
|
|
95
|
+
* @param {Array<'credentials_available' | 'credentials_status_unknown' | 'credentials_unavailable'>} [apple_pay_capabilities] - Device credential statuses that count as available. Defaults to `['credentials_available', 'credentials_status_unknown']` — `credentials_status_unknown` is what third-party / cross-device (QR) browsers report, so the default keeps Apple Pay visible outside Safari.
|
|
96
|
+
* @param {boolean} [sync] - When `true`, runs only the synchronous native same-device check (`window.ApplePaySession` + `canMakePayments()`) and resolves immediately — no merchant resolution, SDK load, or `applePayCapabilities()` query. In this mode `available` reflects the native session only and `payment_credential_status` is `undefined`; it is **not** authoritative for cross-browser / QR availability.
|
|
97
|
+
**/
|
|
98
|
+
/**
|
|
99
|
+
* Result of `ApplePayOpenWalletButton.checkAvailability`. Extends
|
|
100
|
+
* {@link OpenWalletAvailabilityResult}.
|
|
101
|
+
*
|
|
102
|
+
* Infer the transport (Apple does not expose it directly): `available && has_native_session`
|
|
103
|
+
* ⇒ native sheet likely; `available && !has_native_session` ⇒ cross-device / QR handoff likely.
|
|
104
|
+
*
|
|
105
|
+
* @interface ApplePayAvailabilityResult
|
|
106
|
+
* @extends OpenWalletAvailabilityResult
|
|
107
|
+
*
|
|
108
|
+
* @type {object}
|
|
109
|
+
* @param {boolean} available - Whether the device credential status is within the allowed capability set.
|
|
110
|
+
* @param {boolean} supported - Whether Apple Pay is usable here at all (incl. the cross-device QR flow). Derived from `payment_credential_status` (anything other than `applePayUnsupported`); falls back to the native `canMakePayments()` signal when the capabilities query could not run.
|
|
111
|
+
* @param {boolean} has_native_session - Whether a native, same-device Apple Pay session is present right now (`ApplePaySession` exists and `canMakePayments()` is `true`).
|
|
112
|
+
* @param {'paymentCredentialsAvailable' | 'paymentCredentialStatusUnknown' | 'paymentCredentialsUnavailable' | 'applePayUnsupported'} [payment_credential_status] - The raw device-reported credential status. Undefined when unsupported or not queried.
|
|
113
|
+
* @param {string} [reason] - Machine-readable reason when not available: `'unsupported_browser'`, `'missing_merchant_id'`, `'service_type_mismatch'`, `'config_fetch_failed'`, `'sdk_load_failed'`, `'query_failed'`, `'no_credentials'`, or `'no_native_session'` (only from the synchronous `sync: true` check).
|
|
114
|
+
**/
|
|
115
|
+
/**
|
|
116
|
+
* Options for `GooglePayOpenWalletButton.checkAvailability`. Extends
|
|
117
|
+
* {@link OpenWalletAvailabilityOptions}. All fields are optional — Google Pay's
|
|
118
|
+
* `isReadyToPay` check does not require a merchant identifier. Supplying
|
|
119
|
+
* `public_key_or_access_token` + `service_id` additionally validates the service type.
|
|
120
|
+
*
|
|
121
|
+
* @interface GooglePayAvailabilityOptions
|
|
122
|
+
* @extends OpenWalletAvailabilityOptions
|
|
123
|
+
*
|
|
124
|
+
* @type {object}
|
|
125
|
+
* @param {string} [merchant_id] - Google Pay gateway merchant identifier. Optional; the readiness check runs without it.
|
|
126
|
+
* @param {boolean} [sync] - When `true`, reports only whether the Google Pay JS API is already present in the page (no `isReadyToPay` call). It does **not** run the device/card readiness check.
|
|
127
|
+
**/
|
|
128
|
+
/**
|
|
129
|
+
* Result of `GooglePayOpenWalletButton.checkAvailability`. Extends
|
|
130
|
+
* {@link OpenWalletAvailabilityResult}.
|
|
131
|
+
*
|
|
132
|
+
* @interface GooglePayAvailabilityResult
|
|
133
|
+
* @extends OpenWalletAvailabilityResult
|
|
134
|
+
*
|
|
135
|
+
* @type {object}
|
|
136
|
+
* @param {boolean} available - Whether Google Pay is ready to pay in the current context (from `isReadyToPay().result`).
|
|
137
|
+
* @param {boolean} supported - Whether the Google Pay JS API is present and the readiness query could run.
|
|
138
|
+
* @param {boolean} [payment_method_present] - Google's `isReadyToPay` `paymentMethodPresent` — whether the buyer already has a usable payment method. Undefined when not reported.
|
|
139
|
+
* @param {string} [reason] - Machine-readable reason when not available: `'unsupported_browser'`, `'service_type_mismatch'`, `'config_fetch_failed'`, `'sdk_load_failed'`, `'query_failed'`, `'no_payment_method'`, or `'api_not_loaded'` (only from the synchronous `sync: true` check).
|
|
140
|
+
**/
|
|
60
141
|
/**
|
|
61
142
|
* Interface for OnClickEventData.
|
|
62
143
|
* Emitted when the wallet button is clicked.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/open-wallets/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAAE,MAAM,gCAAgC,CAAC;AAM1E,YAAY,EAAE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aG;AAEH;;;;;;;GAOG;AAEH;;;;;;;GAOG;AAEH;;;;;;;;;;GAUG"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import type { OpenWalletAvailabilityOptions, OpenWalletAvailabilityResult } from '../open-wallet-availability.interface';
|
|
2
|
+
/**
|
|
3
|
+
* Friendly capability tokens accepted as **input** — the same values used in
|
|
4
|
+
* `ApplePayOpenWalletMeta.apple_pay_capabilities`. They declare which device
|
|
5
|
+
* credential statuses should be treated as "available".
|
|
6
|
+
*/
|
|
7
|
+
export type ApplePayCapabilityToken = 'credentials_available' | 'credentials_status_unknown' | 'credentials_unavailable';
|
|
8
|
+
/**
|
|
9
|
+
* Device-reported credential status — the **output** of
|
|
10
|
+
* `ApplePaySession.applePayCapabilities()`.
|
|
11
|
+
*/
|
|
12
|
+
export type ApplePayCredentialStatus = 'paymentCredentialsAvailable' | 'paymentCredentialStatusUnknown' | 'paymentCredentialsUnavailable' | 'applePayUnsupported';
|
|
13
|
+
/**
|
|
14
|
+
* Options for `ApplePayOpenWalletButton.checkAvailability`. Provide `merchant_id`
|
|
15
|
+
* directly to skip the network call, **or** provide `public_key_or_access_token` +
|
|
16
|
+
* `service_id` to have the SDK resolve the merchant identifier from the service config.
|
|
17
|
+
*/
|
|
18
|
+
export interface ApplePayAvailabilityOptions extends OpenWalletAvailabilityOptions {
|
|
19
|
+
/** Apple merchant identifier. Provide this OR (`public_key_or_access_token` + `service_id`). */
|
|
20
|
+
merchant_id?: string;
|
|
21
|
+
/**
|
|
22
|
+
* Device credential statuses that count as available. Defaults to
|
|
23
|
+
* `['credentials_available', 'credentials_status_unknown']` — `credentials_status_unknown`
|
|
24
|
+
* is what third-party / cross-device (QR) browsers report, so the default keeps Apple Pay
|
|
25
|
+
* visible outside Safari.
|
|
26
|
+
*/
|
|
27
|
+
apple_pay_capabilities?: ApplePayCapabilityToken[];
|
|
28
|
+
}
|
|
29
|
+
/** Result of `ApplePayOpenWalletButton.checkAvailability`. */
|
|
30
|
+
export interface ApplePayAvailabilityResult extends OpenWalletAvailabilityResult {
|
|
31
|
+
/**
|
|
32
|
+
* Whether a **native, same-device** Apple Pay session is present right now
|
|
33
|
+
* (`ApplePaySession` exists and `canMakePayments()` is `true`). Apple does not expose
|
|
34
|
+
* the transport directly, so use this to infer it: `available && has_native_session` ⇒
|
|
35
|
+
* native sheet likely; `available && !has_native_session` ⇒ cross-device / QR handoff likely.
|
|
36
|
+
*/
|
|
37
|
+
has_native_session: boolean;
|
|
38
|
+
/** The raw device-reported credential status. Undefined when unsupported or not queried. */
|
|
39
|
+
payment_credential_status?: ApplePayCredentialStatus;
|
|
40
|
+
}
|
|
41
|
+
//# sourceMappingURL=apple-pay-availability.interface.d.ts.map
|
package/bundles/types/open-wallets/interfaces/apple-pay/apple-pay-availability.interface.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"apple-pay-availability.interface.d.ts","sourceRoot":"","sources":["../../../../src/open-wallets/interfaces/apple-pay/apple-pay-availability.interface.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,6BAA6B,EAC7B,4BAA4B,EAC7B,MAAM,uCAAuC,CAAC;AAE/C;;;;GAIG;AACH,MAAM,MAAM,uBAAuB,GAC/B,uBAAuB,GACvB,4BAA4B,GAC5B,yBAAyB,CAAC;AAE9B;;;GAGG;AACH,MAAM,MAAM,wBAAwB,GAChC,6BAA6B,GAC7B,gCAAgC,GAChC,+BAA+B,GAC/B,qBAAqB,CAAC;AAE1B;;;;GAIG;AACH,MAAM,WAAW,2BAA4B,SAAQ,6BAA6B;IAChF,gGAAgG;IAChG,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;;;;OAKG;IACH,sBAAsB,CAAC,EAAE,uBAAuB,EAAE,CAAC;CACpD;AAED,8DAA8D;AAC9D,MAAM,WAAW,0BAA2B,SAAQ,4BAA4B;IAC9E;;;;;OAKG;IACH,kBAAkB,EAAE,OAAO,CAAC;IAC5B,4FAA4F;IAC5F,yBAAyB,CAAC,EAAE,wBAAwB,CAAC;CACtD"}
|
|
@@ -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"}
|