@wirexapp/card-wallet-topup-web 0.1.0-beta.5 → 1.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.
@@ -0,0 +1,75 @@
1
+ import type { PciAppearance, PciFrameStrings, PciWalletAvailability, PciWalletBrandingConfig, PciWalletButtonAppearance, PciWalletCheckoutState, PciWalletPaymentTokenDto, PciWalletProviderConfig, PciWalletQuote } from '@wirexapp/card-sdk-core';
2
+ export type PciWalletPaymentToken = PciWalletPaymentTokenDto;
3
+ export interface PciWalletTopUpElementConfig {
4
+ /** From your estimate call (a wallet `payment_method`, no card id). */
5
+ quote: PciWalletQuote;
6
+ /** The provider block of the app config's `topup` section, selected by the
7
+ * ESTIMATE's `provider` field — passed to the frame verbatim. */
8
+ walletConfig: PciWalletProviderConfig;
9
+ appearance?: PciAppearance;
10
+ buttons?: PciWalletButtonAppearance;
11
+ /** `compact` when the host renders its own review UI — the frame shows only
12
+ * the total headline, wallet button and countdown. Default `full`. */
13
+ layout?: 'full' | 'compact';
14
+ /** `popup` when the embedding domain is NOT Apple-verified: the Apple
15
+ * button opens a same-origin popup on the frames domain that runs the
16
+ * session and relays the token back — integration unchanged, one extra
17
+ * click. Default `inline` (requires a verified embedding domain). */
18
+ applePayHandoff?: 'inline' | 'popup';
19
+ /** Logo slot + partner processing disclosure; see PciWalletBrandingConfig. */
20
+ branding?: PciWalletBrandingConfig;
21
+ strings?: PciFrameStrings;
22
+ /** Review screen rendered, buttons live. */
23
+ onReady?: () => void;
24
+ onStateChange?: (state: PciWalletCheckoutState) => void;
25
+ /** The user dismissed the wallet sheet — nothing was tokenized. */
26
+ onCancel?: () => void;
27
+ /** The sheet opened but produced no token (e.g. merchant validation
28
+ * failure). `reason` is a stable slug for messaging/analytics. */
29
+ onAttemptFailed?: (reason: string) => void;
30
+ /** The quote expired in view. Re-estimate through your backend and call
31
+ * `update()` with the fresh quote — no remount needed. */
32
+ onEstimationExpired?: () => void;
33
+ /**
34
+ * The payment sheet authorized. Relay `walletPaymentToken` VERBATIM as the
35
+ * execute call's `wallet_payment_token` (never parse, reshape or log it).
36
+ * The sheet has already closed successfully — its success means
37
+ * "tokenized"; the execute response and your status feed own the top-up
38
+ * outcome. `three_ds_state` is never present on a wallet top-up.
39
+ */
40
+ onToken: (token: PciWalletPaymentToken) => void;
41
+ /** DEV ONLY: arm the frame's diagnostics channel — in-frame JS errors and
42
+ * console output arrive in `onDebug`. Never enable in production. */
43
+ debug?: boolean;
44
+ onDebug?: (level: 'log' | 'warn' | 'error', message: string) => void;
45
+ }
46
+ /**
47
+ * The wallet checkout element — review screen + wallet buttons in one
48
+ * Wirex-served iframe. `mount()` resolves when the frame has rendered the
49
+ * quote; payment attempts are user-gesture-driven inside the frame and
50
+ * surface through the config callbacks.
51
+ */
52
+ export declare class PciWalletTopUpElement {
53
+ private readonly config;
54
+ private readonly channel;
55
+ /** One token per payment attempt; re-armed when a new sheet opens. */
56
+ private attemptSettled;
57
+ constructor(frameUrl: string, config: PciWalletTopUpElementConfig);
58
+ mount(container: HTMLElement): Promise<void>;
59
+ /** Re-arm a mounted element with a fresh quote (typically after
60
+ * `onEstimationExpired`) — re-renders in place. Pass `walletConfig` when
61
+ * the fresh estimate's `provider` selects a different config block. */
62
+ update(quote: PciWalletQuote, walletConfig?: PciWalletProviderConfig): Promise<void>;
63
+ destroy(): void;
64
+ }
65
+ /**
66
+ * Phase-A availability probe: mounts a hidden probe frame that runs
67
+ * `ApplePaySession.canMakePayments()` / Google Pay `isReadyToPay()`
68
+ * (cryptogram-only) and reports booleans. No transaction context, no backend
69
+ * calls. Pass the provider's wallet config when you have it (app config's
70
+ * `topup` block, `default_provider` entry) so the Google check mirrors the
71
+ * real tokenization parameters. Callers cache the result per page session —
72
+ * see `checkWalletAvailability` in `@wirexapp/card-wallet-topup-web`.
73
+ */
74
+ export declare const probeWalletAvailability: (frameUrl: string, config?: PciWalletProviderConfig) => Promise<PciWalletAvailability>;
75
+ //# sourceMappingURL=walletElement.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"walletElement.d.ts","sourceRoot":"","sources":["../src/walletElement.ts"],"names":[],"mappings":"AAcA,OAAO,KAAK,EACV,aAAa,EACb,eAAe,EACf,qBAAqB,EACrB,uBAAuB,EACvB,yBAAyB,EACzB,sBAAsB,EACtB,wBAAwB,EACxB,uBAAuB,EACvB,cAAc,EACf,MAAM,yBAAyB,CAAC;AAEjC,MAAM,MAAM,qBAAqB,GAAG,wBAAwB,CAAC;AAE7D,MAAM,WAAW,2BAA2B;IAC1C,uEAAuE;IACvE,KAAK,EAAE,cAAc,CAAC;IACtB;sEACkE;IAClE,YAAY,EAAE,uBAAuB,CAAC;IACtC,UAAU,CAAC,EAAE,aAAa,CAAC;IAC3B,OAAO,CAAC,EAAE,yBAAyB,CAAC;IACpC;2EACuE;IACvE,MAAM,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC5B;;;0EAGsE;IACtE,eAAe,CAAC,EAAE,QAAQ,GAAG,OAAO,CAAC;IACrC,8EAA8E;IAC9E,QAAQ,CAAC,EAAE,uBAAuB,CAAC;IACnC,OAAO,CAAC,EAAE,eAAe,CAAC;IAC1B,4CAA4C;IAC5C,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,sBAAsB,KAAK,IAAI,CAAC;IACxD,mEAAmE;IACnE,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;IACtB;uEACmE;IACnE,eAAe,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;IAC3C;+DAC2D;IAC3D,mBAAmB,CAAC,EAAE,MAAM,IAAI,CAAC;IACjC;;;;;;OAMG;IACH,OAAO,EAAE,CAAC,KAAK,EAAE,qBAAqB,KAAK,IAAI,CAAC;IAChD;0EACsE;IACtE,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,GAAG,MAAM,GAAG,OAAO,EAAE,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;CACtE;AAED;;;;;GAKG;AACH,qBAAa,qBAAqB;IAChC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAA8B;IACrD,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAkB;IAC1C,sEAAsE;IACtE,OAAO,CAAC,cAAc,CAAS;gBAEnB,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,2BAA2B;IAgC3D,KAAK,CAAC,SAAS,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC;IAoBlD;;4EAEwE;IAClE,MAAM,CAAC,KAAK,EAAE,cAAc,EAAE,YAAY,CAAC,EAAE,uBAAuB,GAAG,OAAO,CAAC,IAAI,CAAC;IAQ1F,OAAO,IAAI,IAAI;CAGhB;AAED;;;;;;;;GAQG;AACH,eAAO,MAAM,uBAAuB,GAClC,UAAU,MAAM,EAChB,SAAS,uBAAuB,KAC/B,OAAO,CAAC,qBAAqB,CAqB/B,CAAC"}
@@ -0,0 +1,121 @@
1
+ /**
2
+ * Wallet top-up (Apple Pay / Google Pay) host-side machinery: the checkout
3
+ * element that mounts the Wirex-hosted wallet frame, and the availability
4
+ * probe. Design: docs/WALLET-TOPUP-DESIGN.md, on the confirmed backend
5
+ * contract ("Wallet Top-Ups Integration").
6
+ *
7
+ * Unlike collect/reveal this is not CHD isolation — wallet tokens are
8
+ * encrypted, gateway-bound blobs. The frame exists for Apple Pay's origin
9
+ * binding: the wallet JS must run on a Wirex-registered domain, so partners
10
+ * skip Apple onboarding entirely. The frame TOKENIZES AND RETURNS: the sheet's
11
+ * encrypted payload arrives in `onToken`, and the HOST calls the execute
12
+ * endpoint with it (`wallet_payment_token`). There is no 3DS on this path.
13
+ */
14
+ import { PciFrameChannel } from '@wirexapp/card-sdk-core';
15
+ /**
16
+ * The wallet checkout element — review screen + wallet buttons in one
17
+ * Wirex-served iframe. `mount()` resolves when the frame has rendered the
18
+ * quote; payment attempts are user-gesture-driven inside the frame and
19
+ * surface through the config callbacks.
20
+ */
21
+ export class PciWalletTopUpElement {
22
+ constructor(frameUrl, config) {
23
+ /** One token per payment attempt; re-armed when a new sheet opens. */
24
+ this.attemptSettled = false;
25
+ this.config = config;
26
+ this.channel = new PciFrameChannel(frameUrl, {}, { allowPayment: true });
27
+ this.channel.onMessage(message => {
28
+ switch (message.type) {
29
+ case 'wallet-state':
30
+ if (message.state === 'sheet-open')
31
+ this.attemptSettled = false;
32
+ this.config.onStateChange?.(message.state);
33
+ break;
34
+ case 'wallet-debug':
35
+ this.config.onDebug?.(message.level, message.message);
36
+ break;
37
+ case 'wallet-cancelled':
38
+ this.config.onCancel?.();
39
+ break;
40
+ case 'wallet-attempt-failed':
41
+ this.config.onAttemptFailed?.(message.reason);
42
+ break;
43
+ case 'wallet-estimation-expired':
44
+ this.config.onEstimationExpired?.();
45
+ break;
46
+ case 'wallet-token':
47
+ if (this.attemptSettled)
48
+ break;
49
+ this.attemptSettled = true;
50
+ this.config.onToken(message.token);
51
+ break;
52
+ default:
53
+ break;
54
+ }
55
+ });
56
+ }
57
+ async mount(container) {
58
+ await this.channel.mount(container);
59
+ await this.channel.request({
60
+ type: 'init',
61
+ config: {
62
+ mode: 'wallet-checkout',
63
+ layout: this.config.layout,
64
+ applePayHandoff: this.config.applePayHandoff,
65
+ quote: this.config.quote,
66
+ config: this.config.walletConfig,
67
+ appearance: this.config.appearance,
68
+ buttons: this.config.buttons,
69
+ branding: this.config.branding,
70
+ strings: this.config.strings,
71
+ debug: this.config.debug,
72
+ },
73
+ });
74
+ this.config.onReady?.();
75
+ }
76
+ /** Re-arm a mounted element with a fresh quote (typically after
77
+ * `onEstimationExpired`) — re-renders in place. Pass `walletConfig` when
78
+ * the fresh estimate's `provider` selects a different config block. */
79
+ async update(quote, walletConfig) {
80
+ await this.channel.request({
81
+ type: 'wallet-update',
82
+ quote,
83
+ config: walletConfig ?? this.config.walletConfig,
84
+ });
85
+ }
86
+ destroy() {
87
+ this.channel.destroy();
88
+ }
89
+ }
90
+ /**
91
+ * Phase-A availability probe: mounts a hidden probe frame that runs
92
+ * `ApplePaySession.canMakePayments()` / Google Pay `isReadyToPay()`
93
+ * (cryptogram-only) and reports booleans. No transaction context, no backend
94
+ * calls. Pass the provider's wallet config when you have it (app config's
95
+ * `topup` block, `default_provider` entry) so the Google check mirrors the
96
+ * real tokenization parameters. Callers cache the result per page session —
97
+ * see `checkWalletAvailability` in `@wirexapp/card-wallet-topup-web`.
98
+ */
99
+ export const probeWalletAvailability = async (frameUrl, config) => {
100
+ // Zero-sized but not display:none/visibility:hidden — some wallet
101
+ // availability checks report unavailable inside hidden documents.
102
+ const container = document.createElement('div');
103
+ container.style.position = 'fixed';
104
+ container.style.width = '0';
105
+ container.style.height = '0';
106
+ container.style.overflow = 'hidden';
107
+ document.body.appendChild(container);
108
+ const channel = new PciFrameChannel(frameUrl, {}, { allowPayment: true });
109
+ try {
110
+ await channel.mount(container);
111
+ return await channel.request({
112
+ type: 'init',
113
+ config: { mode: 'wallet-probe', config },
114
+ });
115
+ }
116
+ finally {
117
+ channel.destroy();
118
+ container.remove();
119
+ }
120
+ };
121
+ //# sourceMappingURL=walletElement.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"walletElement.js","sourceRoot":"","sources":["../src/walletElement.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AA2D1D;;;;;GAKG;AACH,MAAM,OAAO,qBAAqB;IAMhC,YAAY,QAAgB,EAAE,MAAmC;QAHjE,sEAAsE;QAC9D,mBAAc,GAAG,KAAK,CAAC;QAG7B,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,OAAO,GAAG,IAAI,eAAe,CAAC,QAAQ,EAAE,EAAE,EAAE,EAAE,YAAY,EAAE,IAAI,EAAE,CAAC,CAAC;QACzE,IAAI,CAAC,OAAO,CAA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,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,SAAS,CAAC,CAAC;IAErC,MAAM,OAAO,GAAG,IAAI,eAAe,CAAC,QAAQ,EAAE,EAAE,EAAE,EAAE,YAAY,EAAE,IAAI,EAAE,CAAC,CAAC;IAC1E,IAAI,CAAC;QACH,MAAM,OAAO,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC;QAC/B,OAAO,MAAM,OAAO,CAAC,OAAO,CAAwB;YAClD,IAAI,EAAE,MAAM;YACZ,MAAM,EAAE,EAAE,IAAI,EAAE,cAAc,EAAE,MAAM,EAAE;SACzC,CAAC,CAAC;IACL,CAAC;YAAS,CAAC;QACT,OAAO,CAAC,OAAO,EAAE,CAAC;QAClB,SAAS,CAAC,MAAM,EAAE,CAAC;IACrB,CAAC;AACH,CAAC,CAAC"}
@@ -0,0 +1,32 @@
1
+ import type { PciWalletTopUpElementConfig } from './walletElement.js';
2
+ export interface PciWalletTopUpPopupConfig extends Omit<PciWalletTopUpElementConfig, 'quote' | 'walletConfig'> {
3
+ /** The quote may be OMITTED at open time: `window.open` must run
4
+ * synchronously inside the click handler, while the estimate is usually
5
+ * still in flight — open first, then call `arm(quote, walletConfig)` when
6
+ * the estimate lands. Providing both here arms immediately. */
7
+ quote?: PciWalletTopUpElementConfig['quote'];
8
+ walletConfig?: PciWalletTopUpElementConfig['walletConfig'];
9
+ /** The popup was closed (by the user or programmatically) without a token.
10
+ * Not fired after `onToken` — a token hand-off closes the popup too. */
11
+ onClose?: () => void;
12
+ /** The popup failed to boot: blocked by the browser (call `open` from a
13
+ * click handler), or the frame never became ready. */
14
+ onMountError?: (error: Error) => void;
15
+ }
16
+ export interface PciWalletTopUpPopup {
17
+ /** Deliver the quote when it wasn't available at open time (the estimate
18
+ * resolved after the click). First call initializes the checkout; later
19
+ * calls behave like `update`. No-op after the popup closed. */
20
+ arm(quote: PciWalletTopUpElementConfig['quote'], walletConfig: PciWalletTopUpElementConfig['walletConfig']): void;
21
+ /** Re-arm with a fresh quote (after `onEstimationExpired`) — re-renders in
22
+ * place, the popup stays open. */
23
+ update(quote: PciWalletTopUpElementConfig['quote'], walletConfig?: PciWalletTopUpElementConfig['walletConfig']): Promise<void>;
24
+ /** Close the popup. Fires `onClose` if nothing was tokenized yet. */
25
+ close(): void;
26
+ }
27
+ /**
28
+ * Opens the wallet checkout in a popup. MUST be called synchronously from a
29
+ * user gesture (click handler) or browsers will block the window.
30
+ */
31
+ export declare const openWalletTopUpPopup: (frameUrl: string, config: PciWalletTopUpPopupConfig) => PciWalletTopUpPopup;
32
+ //# sourceMappingURL=walletPopup.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"walletPopup.d.ts","sourceRoot":"","sources":["../src/walletPopup.ts"],"names":[],"mappings":"AAkBA,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,iBAAiB,CAAC;AAgBnE,MAAM,WAAW,yBAA0B,SAAQ,IAAI,CAAC,2BAA2B,EAAE,OAAO,GAAG,cAAc,CAAC;IAC5G;;;oEAGgE;IAChE,KAAK,CAAC,EAAE,2BAA2B,CAAC,OAAO,CAAC,CAAC;IAC7C,YAAY,CAAC,EAAE,2BAA2B,CAAC,cAAc,CAAC,CAAC;IAC3D;6EACyE;IACzE,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB;2DACuD;IACvD,YAAY,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;CACvC;AAED,MAAM,WAAW,mBAAmB;IAClC;;oEAEgE;IAChE,GAAG,CAAC,KAAK,EAAE,2BAA2B,CAAC,OAAO,CAAC,EAAE,YAAY,EAAE,2BAA2B,CAAC,cAAc,CAAC,GAAG,IAAI,CAAC;IAClH;uCACmC;IACnC,MAAM,CAAC,KAAK,EAAE,2BAA2B,CAAC,OAAO,CAAC,EAAE,YAAY,CAAC,EAAE,2BAA2B,CAAC,cAAc,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC/H,qEAAqE;IACrE,KAAK,IAAI,IAAI,CAAC;CACf;AAED;;;GAGG;AACH,eAAO,MAAM,oBAAoB,GAC/B,UAAU,MAAM,EAChB,QAAQ,yBAAyB,KAChC,mBA+KF,CAAC"}
@@ -0,0 +1,211 @@
1
+ /**
2
+ * Wallet checkout POPUP (Mode B): the same wallet-checkout document, opened
3
+ * TOP-LEVEL on the frames domain via `window.open`, driven over
4
+ * `window.opener` postMessage with the same channel + origin checks as the
5
+ * iframe transport (`openerTransport` in the frame's bridge).
6
+ *
7
+ * Why this mode exists: Apple binds merchant sessions to the TOP-LEVEL
8
+ * page's domain. Embedded as an iframe, that is the PARTNER's domain — which
9
+ * must be registered + verified under Wirex's Apple merchant ID and host the
10
+ * domain-association file. In a popup the top-level domain is the frames
11
+ * origin itself, which is already verified — partners need NO Apple steps at
12
+ * all. The trade-off is the user briefly leaving the host page.
13
+ *
14
+ * The tokenize-and-return contract is unchanged: the sheet's encrypted
15
+ * payload arrives in `onToken` and the HOST calls execute; the popup closes
16
+ * itself once the token is handed off.
17
+ */
18
+ import { PCI_PROTOCOL_VERSION } from '@wirexapp/card-sdk-core';
19
+ const READY_TIMEOUT_MS = 15000;
20
+ const REQUEST_TIMEOUT_MS = 30000;
21
+ const CLOSE_POLL_MS = 400;
22
+ /** ~mobile-sheet proportions, centered by the browser. */
23
+ const POPUP_FEATURES = 'popup=yes,width=430,height=780,resizable=yes,scrollbars=yes';
24
+ /** The checkout renders on a transparent surface for iframes; a top-level
25
+ * popup needs an opaque ground. Overridable via appearance.surfaceColor. */
26
+ const POPUP_DEFAULT_SURFACE = '#141414';
27
+ const randomId = () => typeof crypto !== 'undefined' && 'randomUUID' in crypto
28
+ ? crypto.randomUUID()
29
+ : `${Date.now()}-${Math.random().toString(36).slice(2)}`;
30
+ /**
31
+ * Opens the wallet checkout in a popup. MUST be called synchronously from a
32
+ * user gesture (click handler) or browsers will block the window.
33
+ */
34
+ export const openWalletTopUpPopup = (frameUrl, config) => {
35
+ const frameOrigin = new URL(frameUrl, window.location.href).origin;
36
+ const channelId = randomId();
37
+ const url = `${frameUrl}#channel=${channelId}&parent=${encodeURIComponent(window.location.origin)}`;
38
+ const popup = window.open(url, '_blank', POPUP_FEATURES);
39
+ const pending = new Map();
40
+ let settled = false; // a token was handed off
41
+ let closed = false;
42
+ let closePoll = null;
43
+ let readyTimer = null;
44
+ /** One payment attempt per sheet opening (mirrors the element). */
45
+ let attemptSettled = false;
46
+ // Deferred-arm state: the frame may report ready before the host has a
47
+ // quote (estimate in flight), or the quote may arrive first — init is sent
48
+ // once BOTH are true.
49
+ let frameReady = false;
50
+ let initialized = false;
51
+ let armedQuote = config.quote ?? null;
52
+ let armedWalletConfig = config.walletConfig ?? null;
53
+ const cleanup = () => {
54
+ if (closed)
55
+ return;
56
+ closed = true;
57
+ if (closePoll)
58
+ clearInterval(closePoll);
59
+ if (readyTimer)
60
+ clearTimeout(readyTimer);
61
+ window.removeEventListener('message', onWindowMessage);
62
+ for (const [, entry] of pending) {
63
+ clearTimeout(entry.timer);
64
+ entry.reject(new Error('Wallet popup closed'));
65
+ }
66
+ pending.clear();
67
+ };
68
+ const closePopup = () => {
69
+ const wasSettled = settled;
70
+ cleanup();
71
+ if (popup && !popup.closed)
72
+ popup.close();
73
+ if (!wasSettled)
74
+ config.onClose?.();
75
+ };
76
+ const request = (message) => {
77
+ if (!popup || popup.closed || closed)
78
+ return Promise.reject(new Error('Wallet popup is not open'));
79
+ const requestId = randomId();
80
+ const promise = new Promise((resolve, reject) => {
81
+ const timer = setTimeout(() => {
82
+ pending.delete(requestId);
83
+ reject(new Error('Wallet popup request timed out'));
84
+ }, REQUEST_TIMEOUT_MS);
85
+ pending.set(requestId, { resolve: resolve, reject, timer });
86
+ });
87
+ popup.postMessage({ ...message, requestId, v: PCI_PROTOCOL_VERSION, channel: channelId }, frameOrigin);
88
+ return promise;
89
+ };
90
+ const sendInit = () => {
91
+ if (initialized || !frameReady || !armedQuote || !armedWalletConfig)
92
+ return;
93
+ initialized = true;
94
+ request({
95
+ type: 'init',
96
+ config: {
97
+ mode: 'wallet-checkout',
98
+ layout: config.layout,
99
+ quote: armedQuote,
100
+ config: armedWalletConfig,
101
+ appearance: {
102
+ ...config.appearance,
103
+ variables: { surfaceColor: POPUP_DEFAULT_SURFACE, ...config.appearance?.variables },
104
+ },
105
+ buttons: config.buttons,
106
+ branding: config.branding,
107
+ strings: config.strings,
108
+ debug: config.debug,
109
+ },
110
+ })
111
+ .then(() => config.onReady?.())
112
+ .catch((error) => config.onMountError?.(error));
113
+ };
114
+ const onWindowMessage = (event) => {
115
+ // Provenance: our popup window + the frames origin + our channel id.
116
+ if (!popup || event.source !== popup)
117
+ return;
118
+ if (event.origin !== frameOrigin)
119
+ return;
120
+ const message = event.data;
121
+ if (!message || message.v !== PCI_PROTOCOL_VERSION || message.channel !== channelId)
122
+ return;
123
+ switch (message.type) {
124
+ case 'ready':
125
+ if (readyTimer)
126
+ clearTimeout(readyTimer);
127
+ readyTimer = null;
128
+ frameReady = true;
129
+ sendInit();
130
+ break;
131
+ case 'result': {
132
+ const entry = pending.get(message.requestId);
133
+ if (!entry)
134
+ break;
135
+ pending.delete(message.requestId);
136
+ clearTimeout(entry.timer);
137
+ if (message.ok)
138
+ entry.resolve(message.data);
139
+ else
140
+ entry.reject(new Error(message.error?.message ?? 'Wallet popup request failed'));
141
+ break;
142
+ }
143
+ case 'wallet-state':
144
+ if (message.state === 'sheet-open')
145
+ attemptSettled = false;
146
+ config.onStateChange?.(message.state);
147
+ break;
148
+ case 'wallet-debug':
149
+ config.onDebug?.(message.level, message.message);
150
+ break;
151
+ case 'wallet-cancelled':
152
+ config.onCancel?.();
153
+ break;
154
+ case 'wallet-attempt-failed':
155
+ config.onAttemptFailed?.(message.reason);
156
+ break;
157
+ case 'wallet-estimation-expired':
158
+ config.onEstimationExpired?.();
159
+ break;
160
+ case 'wallet-token':
161
+ if (attemptSettled)
162
+ break;
163
+ attemptSettled = true;
164
+ settled = true;
165
+ // Hand the token to the host FIRST, then close — the host executes.
166
+ config.onToken(message.token);
167
+ closePopup();
168
+ break;
169
+ default:
170
+ break;
171
+ }
172
+ };
173
+ if (!popup) {
174
+ // Blocked: window.open returned null (not called from a user gesture, or
175
+ // a popup blocker). Report async so the caller's flow stays uniform.
176
+ setTimeout(() => config.onMountError?.(new Error('Wallet popup was blocked — open it from a click handler')), 0);
177
+ return {
178
+ arm: () => { },
179
+ update: () => Promise.reject(new Error('Wallet popup was blocked')),
180
+ close: () => { },
181
+ };
182
+ }
183
+ window.addEventListener('message', onWindowMessage);
184
+ readyTimer = setTimeout(() => {
185
+ config.onMountError?.(new Error('Wallet popup did not become ready in time'));
186
+ closePopup();
187
+ }, READY_TIMEOUT_MS);
188
+ closePoll = setInterval(() => {
189
+ if (popup.closed)
190
+ closePopup();
191
+ }, CLOSE_POLL_MS);
192
+ return {
193
+ arm: (quote, walletConfig) => {
194
+ if (closed)
195
+ return;
196
+ if (initialized) {
197
+ // Already armed once — behave like update (fresh estimate).
198
+ armedQuote = quote;
199
+ armedWalletConfig = walletConfig;
200
+ void request({ type: 'wallet-update', quote, config: walletConfig }).catch(() => undefined);
201
+ return;
202
+ }
203
+ armedQuote = quote;
204
+ armedWalletConfig = walletConfig;
205
+ sendInit();
206
+ },
207
+ update: (quote, walletConfig) => request({ type: 'wallet-update', quote, config: walletConfig ?? armedWalletConfig ?? undefined }).then(() => undefined),
208
+ close: closePopup,
209
+ };
210
+ };
211
+ //# sourceMappingURL=walletPopup.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"walletPopup.js","sourceRoot":"","sources":["../src/walletPopup.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AACH,OAAO,EAAE,oBAAoB,EAA0D,MAAM,yBAAyB,CAAC;AAGvH,MAAM,gBAAgB,GAAG,KAAM,CAAC;AAChC,MAAM,kBAAkB,GAAG,KAAM,CAAC;AAClC,MAAM,aAAa,GAAG,GAAG,CAAC;AAC1B,0DAA0D;AAC1D,MAAM,cAAc,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pD,UAAU,GAAG,UAAU,CAAC,GAAG,EAAE;QAC3B,MAAM,CAAC,YAAY,EAAE,CAAC,IAAI,KAAK,CAAC,2CAA2C,CAAC,CAAC,CAAC;QAC9E,UAAU,EAAE,CAAC;IACf,CAAC,EAAE,gBAAgB,CAAC,CAAC;IACrB,SAAS,GAAG,WAAW,CAAC,GAAG,EAAE;QAC3B,IAAI,KAAK,CAAC,MAAM;YAAE,UAAU,EAAE,CAAC;IACjC,CAAC,EAAE,aAAa,CAAC,CAAC;IAElB,OAAO;QACL,GAAG,EAAE,CAAC,KAAK,EAAE,YAAY,EAAE,EAAE;YAC3B,IAAI,MAAM;gBAAE,OAAO;YACnB,IAAI,WAAW,EAAE,CAAC;gBAChB,4DAA4D;gBAC5D,UAAU,GAAG,KAAK,CAAC;gBACnB,iBAAiB,GAAG,YAAY,CAAC;gBACjC,KAAK,OAAO,CAAC,EAAE,IAAI,EAAE,eAAe,EAAE,KAAK,EAAE,MAAM,EAAE,YAAY,EAGhE,CAAC,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,SAAS,CAAC,CAAC;gBAC1B,OAAO;YACT,CAAC;YACD,UAAU,GAAG,KAAK,CAAC;YACnB,iBAAiB,GAAG,YAAY,CAAC;YACjC,QAAQ,EAAE,CAAC;QACb,CAAC;QACD,MAAM,EAAE,CAAC,KAAK,EAAE,YAAY,EAAE,EAAE,CAC9B,OAAO,CAAC,EAAE,IAAI,EAAE,eAAe,EAAE,KAAK,EAAE,MAAM,EAAE,YAAY,IAAI,iBAAiB,IAAI,SAAS,EAG7F,CAAC,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,SAAS,CAAC;QAC1B,KAAK,EAAE,UAAU;KAClB,CAAC;AACJ,CAAC,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wirexapp/card-wallet-topup-web",
3
- "version": "0.1.0-beta.5",
3
+ "version": "1.0.0",
4
4
  "type": "module",
5
5
  "description": "Top up via Apple Pay / Google Pay inside a Wirex-served checkout iframe — review screen + wallet buttons under Wirex's merchant identity; the payment sheet's encrypted token is returned to the host, which executes the top-up. No wallet onboarding on the partner side.",
6
6
  "license": "UNLICENSED",
@@ -37,6 +37,6 @@
37
37
  "prepublishOnly": "yarn clean && yarn build"
38
38
  },
39
39
  "dependencies": {
40
- "@wirexapp/card-sdk-core": "0.1.0-beta.5"
40
+ "@wirexapp/card-sdk-core": "1.0.0"
41
41
  }
42
42
  }