@salla.sa/applepay 2.14.590 → 2.14.592

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@salla.sa/applepay",
3
- "version": "2.14.590",
3
+ "version": "2.14.592",
4
4
  "description": "Salla Apple Pay light",
5
5
  "main": "dist/app.js",
6
6
  "scripts": {
@@ -26,5 +26,5 @@
26
26
  "dependencies": {
27
27
  "axios": "^1.10.0"
28
28
  },
29
- "gitHead": "675fcebfdd69e92b2d8ee6c2bb931d0c26a44144"
29
+ "gitHead": "12f0bbab3a374a70ee21559a1eda594bf51e671e"
30
30
  }
@@ -9,6 +9,8 @@ export declare function buildApplePayMethodData(opts: {
9
9
  countryCode: string;
10
10
  }): PaymentMethodData[];
11
11
 
12
+ export declare function isApplePayHostedRedirect(): boolean;
13
+
12
14
  export declare function ensureApplePaySdk(): Promise<void>;
13
15
 
14
16
  export declare function normalizeApplePayNetworks(raw: string[] | Record<string, string> | null | undefined): string[];
@@ -30,6 +30,23 @@ export function applePayMerchantId() {
30
30
  return salla?.config?.get?.('store.settings.buy_now.merchant_identifier') || null;
31
31
  }
32
32
 
33
+ /**
34
+ * Whether the store's Apple Pay is a hosted redirect rather than a native sheet.
35
+ *
36
+ * MyFatoorah Apple Pay without S2S has no native flow: the checkout page hands off as a
37
+ * credit_card redirect to MyFatoorah's hosted page. The buy-now surfaces (PDP, sticky bar)
38
+ * have no redirect path, so they must not offer an Apple Pay button at all.
39
+ *
40
+ * The backend publishes this as a single boolean (`ApplePayFeature::isHostedRedirect`).
41
+ * Compared with `=== true` on purpose: against a backend that predates the field the key is
42
+ * absent, so this returns false and every surface keeps its current behaviour. That is what
43
+ * makes the storefront half safe to ship independently of the backend half.
44
+ * @returns {boolean}
45
+ */
46
+ export function isApplePayHostedRedirect() {
47
+ return salla?.config?.get?.('store.settings.buy_now.hostedRedirect') === true;
48
+ }
49
+
33
50
  /**
34
51
  * Build the W3C Payment Request `methodData` for the Apple Pay method. Callers
35
52
  * supply the values (the probe reads them from config; the live session reads