@economist/web-apple-pay 1.15.1 → 1.15.3-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -20,6 +20,8 @@ It is intentionally UI-focused. Consumer applications own backend payment orches
20
20
  npm install --save @economist/web-apple-pay
21
21
  ```
22
22
 
23
+ Pre-release builds from the `beta` branch install as `@economist/web-apple-pay@beta`.
24
+
23
25
  ## Quick start
24
26
 
25
27
  ### 1) Configure runtime values
@@ -147,7 +149,7 @@ Consumers should listen for this event and continue payment orchestration.
147
149
  - `createIfEnabled(offer, country, entryPoint?)`: returns a configured button or `null`.
148
150
  - `DUAL_OFFER_BANNER` (or omitted): always-on after offer exclusions — no homepage/Safari gate at `createIfEnabled` (device gating via `isApplePayAvailable` on mount).
149
151
  - `FREE_TRIAL_BANNER`: same always-on-after-exclusions gate as Dual; wallet impression `entry_point` is `free_trial_banner`.
150
- - `FREE_TRIAL_POPUP`: same always-on-after-exclusions gate. Wallet impression `entry_point` is `free_trial_popup`.
152
+ - `FREE_TRIAL_POPUP`: same always-on-after-exclusions gate. Wallet impression `entry_point` is `free_trial_popup`. Payment success uses the same complete statuses as other entry points (`lex` logged-in, `nex` anonymous). The origin URL is still written to `checkout-redirect` for sma-checkout.
151
153
  - `SUBSCRIBE`: same always-on-after-exclusions gate for `/subscribe` (sma-checkout); no Amplitude. Wallet impression `entry_point` is `subscribe`.
152
154
  - `PAYWALL`: always-on after offer exclusions + Safari/Apple placement eligibility. No Amplitude experiment / `$exposure`.
153
155
  - `REGWALL`: inert — always returns `null`.
package/dist/index.js CHANGED
@@ -2410,7 +2410,8 @@ var ApplePayButton = class _ApplePayButton extends HTMLElement {
2410
2410
  currency: offer.price?.currency_code ?? DEFAULT_CURRENCY,
2411
2411
  returnUrl: this.#checkoutRedirectUrl,
2412
2412
  supportedBillingCountries: this.#supportedBillingCountries,
2413
- recaptchaToken
2413
+ recaptchaToken,
2414
+ entryPoint: this.#entryPoint
2414
2415
  });
2415
2416
  }
2416
2417
  };
@@ -2394,7 +2394,8 @@ var ApplePayButton = class _ApplePayButton extends HTMLElement {
2394
2394
  currency: offer.price?.currency_code ?? DEFAULT_CURRENCY,
2395
2395
  returnUrl: this.#checkoutRedirectUrl,
2396
2396
  supportedBillingCountries: this.#supportedBillingCountries,
2397
- recaptchaToken
2397
+ recaptchaToken,
2398
+ entryPoint: this.#entryPoint
2398
2399
  });
2399
2400
  }
2400
2401
  };
@@ -2402,7 +2402,8 @@ var ApplePayButton = class _ApplePayButton extends HTMLElement {
2402
2402
  currency: offer.price?.currency_code ?? DEFAULT_CURRENCY,
2403
2403
  returnUrl: this.#checkoutRedirectUrl,
2404
2404
  supportedBillingCountries: this.#supportedBillingCountries,
2405
- recaptchaToken
2405
+ recaptchaToken,
2406
+ entryPoint: this.#entryPoint
2406
2407
  });
2407
2408
  }
2408
2409
  };
@@ -2394,7 +2394,8 @@ var ApplePayButton = class _ApplePayButton extends HTMLElement {
2394
2394
  currency: offer.price?.currency_code ?? DEFAULT_CURRENCY,
2395
2395
  returnUrl: this.#checkoutRedirectUrl,
2396
2396
  supportedBillingCountries: this.#supportedBillingCountries,
2397
- recaptchaToken
2397
+ recaptchaToken,
2398
+ entryPoint: this.#entryPoint
2398
2399
  });
2399
2400
  }
2400
2401
  };
@@ -14,6 +14,7 @@
14
14
  * 4. Handling structured BFF errors → deterministic UI actions per errorType
15
15
  */
16
16
  import type { SessionResponse } from './types';
17
+ import { ApplePayEntryPoint } from '../../constants';
17
18
  export type PaymentHandlerConfig = {
18
19
  skuId: string;
19
20
  country: string;
@@ -22,5 +23,7 @@ export type PaymentHandlerConfig = {
22
23
  returnUrl: string | null;
23
24
  supportedBillingCountries: string[];
24
25
  recaptchaToken: string;
26
+ /** Host entry point. Complete status is `lex` / `nex` from the session, not from this. */
27
+ entryPoint?: ApplePayEntryPoint | '';
25
28
  };
26
29
  export declare function handlePaymentAuthorized(event: ApplePayJS.ApplePayPaymentAuthorizedEvent, session: ApplePaySession, sessionData: SessionResponse, config: PaymentHandlerConfig): Promise<void>;
package/dist/src/index.js CHANGED
@@ -2410,7 +2410,8 @@ var ApplePayButton = class _ApplePayButton extends HTMLElement {
2410
2410
  currency: offer.price?.currency_code ?? DEFAULT_CURRENCY,
2411
2411
  returnUrl: this.#checkoutRedirectUrl,
2412
2412
  supportedBillingCountries: this.#supportedBillingCountries,
2413
- recaptchaToken
2413
+ recaptchaToken,
2414
+ entryPoint: this.#entryPoint
2414
2415
  });
2415
2416
  }
2416
2417
  };
@@ -58,7 +58,8 @@ export declare const decodeSku: (sku: string) => string;
58
58
  * Always appended when non-empty to preserve geo-context across the redirect.
59
59
  *
60
60
  * The origin article URL is written to localStorage by the caller via
61
- * writeCheckoutRedirect() before this redirect fires.
61
+ * writeCheckoutRedirect() so sma-checkout can return the reader after
62
+ * passwordless confirmation or after onboarding.
62
63
  */
63
64
  export declare const redirectToCheckoutComplete: (params: {
64
65
  basketId: string;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@economist/web-apple-pay",
3
3
  "description": "Web component package for Apple Pay checkout UI",
4
- "version": "1.15.1",
4
+ "version": "1.15.3-beta.1",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
7
7
  "types": "dist/index.d.ts",