@economist/web-apple-pay 2.0.0-beta.2 → 2.0.0-beta.3
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 +26 -8
- package/dist/index.js +647 -349
- package/dist/src/apple-pay-button.d.ts +18 -16
- package/dist/src/apple-pay-button.js +636 -340
- package/dist/src/apple-pay-button.stories.js +633 -339
- package/dist/src/apple-pay-modal.js +44 -39
- package/dist/src/apple-pay-modal.stories.js +633 -339
- package/dist/src/clients/payment-checkout/apple-session.d.ts +14 -1
- package/dist/src/clients/payment-checkout/apple-session.js +46 -11
- package/dist/src/clients/payment-checkout/billing-contact-details.js +43 -0
- package/dist/src/clients/payment-checkout/delivery-contact-details.d.ts +16 -0
- package/dist/src/clients/payment-checkout/delivery-contact-details.js +395 -0
- package/dist/src/clients/payment-checkout/detects.d.ts +5 -0
- package/dist/src/clients/payment-checkout/detects.js +18 -14
- package/dist/src/clients/payment-checkout/messages.d.ts +6 -0
- package/dist/src/clients/payment-checkout/messages.js +7 -1
- package/dist/src/clients/payment-checkout/payment-handler.d.ts +10 -1
- package/dist/src/clients/payment-checkout/payment-handler.js +397 -30
- package/dist/src/clients/payment-checkout/session.js +13 -1
- package/dist/src/clients/payment-checkout/types.d.ts +7 -0
- package/dist/src/constants.d.ts +7 -28
- package/dist/src/constants.js +3 -7
- package/dist/src/index.d.ts +2 -4
- package/dist/src/index.js +647 -349
- package/dist/src/types/offer.types.d.ts +1 -1
- package/dist/src/utils/address-rules.d.ts +23 -0
- package/dist/src/utils/address-rules.js +258 -0
- package/dist/src/utils/addressParityFlag.d.ts +13 -0
- package/dist/src/utils/addressParityFlag.js +5 -0
- package/dist/src/utils/applePayExpressEligibility.d.ts +5 -6
- package/dist/src/utils/applePayExpressEligibility.js +2 -2
- package/dist/src/utils/buttonCopyFlag.d.ts +22 -0
- package/dist/src/utils/buttonCopyFlag.js +12 -0
- package/dist/src/utils/delivery-countries.d.ts +9 -0
- package/dist/src/utils/delivery-countries.js +255 -0
- package/dist/src/utils/expressCheckoutRedirect.d.ts +20 -2
- package/dist/src/utils/expressCheckoutRedirect.js +13 -1
- package/dist/src/utils/expressCheckoutTracking.d.ts +0 -15
- package/dist/src/utils/expressCheckoutTracking.js +0 -27
- package/dist/src/utils/latin-characters.d.ts +3 -0
- package/dist/src/utils/latin-characters.js +10 -0
- package/dist/src/utils/printOffersFlag.d.ts +11 -0
- package/dist/src/utils/printOffersFlag.js +5 -0
- package/dist/src/utils/recaptcha.d.ts +3 -2
- package/dist/src/utils/recaptcha.js +17 -8
- package/package.json +1 -1
- package/dist/src/apple-pay-logo.d.ts +0 -1
- package/dist/src/apple-pay-logo.js +0 -14
- package/dist/src/types/experiment-integration.d.js +0 -0
- package/dist/src/utils/getExperimentKeyFromNextData.d.ts +0 -8
- package/dist/src/utils/getExperimentKeyFromNextData.js +0 -9
|
@@ -1,6 +1,16 @@
|
|
|
1
1
|
import type { Offer, ProductVariant } from './types/offer.types';
|
|
2
2
|
import { ApplePayEntryPoint } from './constants';
|
|
3
|
+
/**
|
|
4
|
+
* @deprecated Print offers are now excluded per entry point; use `getExcludedVariants(entryPoint)`. Kept as
|
|
5
|
+
* the default (surfaces that do not take print offers) so existing hosts behave exactly as before.
|
|
6
|
+
*/
|
|
3
7
|
export declare const APPLE_PAY_EXCLUDED_VARIANTS: readonly ProductVariant[];
|
|
8
|
+
/**
|
|
9
|
+
* Variants an entry point never offers Apple Pay for (unknown / missing entry points use the default
|
|
10
|
+
* entry point's rule, as in `createIfEnabled`). Hosts that update `button.offer` in place use this to apply
|
|
11
|
+
* the same rule `createIfEnabled` applies on creation.
|
|
12
|
+
*/
|
|
13
|
+
export declare const getExcludedVariants: (entryPoint?: ApplePayEntryPoint) => readonly ProductVariant[];
|
|
4
14
|
export declare class ApplePayButton extends HTMLElement {
|
|
5
15
|
#private;
|
|
6
16
|
static readonly tag = "teg-apple-pay-button";
|
|
@@ -9,26 +19,18 @@ export declare class ApplePayButton extends HTMLElement {
|
|
|
9
19
|
* Creates and configures an ApplePayButton when the entry point allows it.
|
|
10
20
|
*
|
|
11
21
|
* - `DUAL_OFFER_BANNER` (or omitted): always-on after offer exclusions —
|
|
12
|
-
* no homepage/Safari gate here
|
|
13
|
-
*
|
|
22
|
+
* no homepage/Safari gate here. Safari/Apple is enforced later by
|
|
23
|
+
* `isApplePayAvailable()` on mount.
|
|
14
24
|
* - `FREE_TRIAL_BANNER`: same always-on-after-exclusions gate as Dual; distinct
|
|
15
25
|
* TEDL `entry_point` string (`free_trial_banner`) for wallet impression attribution.
|
|
16
|
-
* - `
|
|
17
|
-
* (`
|
|
18
|
-
*
|
|
26
|
+
* - `FREE_TRIAL_POPUP`: same always-on-after-exclusions gate. Distinct TEDL
|
|
27
|
+
* `entry_point` (`free_trial_popup`).
|
|
28
|
+
* - `PAYWALL`: always-on after offer exclusions + Safari/Apple placement
|
|
29
|
+
* eligibility. No Amplitude experiment / `$exposure`.
|
|
19
30
|
* - `REGWALL`: inert — always returns null.
|
|
20
31
|
*
|
|
21
|
-
*
|
|
22
|
-
* `
|
|
23
|
-
* treatment (and without inflating `$exposure`). For banners there is no
|
|
24
|
-
* experiment gate; `BYPASS_APPLE_PAY_CHECKS` only skips device checks in
|
|
25
|
-
* `isApplePayAvailable()` on mount.
|
|
26
|
-
*
|
|
27
|
-
* **Eligibility:**
|
|
28
|
-
* - `DUAL_OFFER_BANNER` / `FREE_TRIAL_BANNER` (or omitted): always eligible at
|
|
29
|
-
* this gate (homepage placement is host-owned; Safari/Apple is enforced
|
|
30
|
-
* later by `isApplePayAvailable()` on mount)
|
|
31
|
-
* - `PAYWALL`: Safari/Apple device only (no homepage) — article paywalls
|
|
32
|
+
* `BYPASS_APPLE_PAY_CHECKS` skips placement eligibility here and device checks
|
|
33
|
+
* in `isApplePayAvailable()` on mount (QA on non-Apple browsers).
|
|
32
34
|
*
|
|
33
35
|
* @param offer - The offer to display in the Apple Pay flow.
|
|
34
36
|
* @param country - The user's country code.
|