@fire-spark/core 0.38.7 → 0.40.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.
package/dist/index.d.ts CHANGED
@@ -1367,7 +1367,7 @@ interface CartPlacement {
1367
1367
  declare const placeCartLines: (root: OrderLine, lines: OrderLine[], lookup: MenuLookup$1, locale: string) => CartPlacement;
1368
1368
  //#endregion
1369
1369
  //#region src/order/fees.d.ts
1370
- /** Root FEE line whose `metadata.fee_based_on` is a delivery/shipping basis. */
1370
+ /** Root FEE line that is a delivery/shipping fee. */
1371
1371
  declare const isShippingFeeLine: (line: OrderLine) => boolean;
1372
1372
  /** First root shipping/delivery FEE line in `lines`, if any. */
1373
1373
  declare const findShippingFeeLine: (lines: readonly OrderLine[]) => OrderLine | undefined;
package/dist/index.js CHANGED
@@ -4552,6 +4552,8 @@ const SDK_PAYMENT_ELIGIBILITY_CEILINGS = {
4552
4552
  "medianet:PIN_PAD": LOCAL_ONLY,
4553
4553
  "transbank:PIN_PAD": LOCAL_ONLY,
4554
4554
  "redeban:PIN_PAD": LOCAL_ONLY,
4555
+ "posnet:PIN_PAD": LOCAL_ONLY,
4556
+ "posnet:WALLET": LOCAL_ONLY,
4555
4557
  "sitef_venezuela:PIN_PAD": LOCAL_ONLY,
4556
4558
  "mxp_paybridge:PIN_PAD": LOCAL_ONLY,
4557
4559
  "kushki:PIN_PAD": LOCAL_ONLY,
@@ -7394,7 +7396,7 @@ const pickMultiLanguageText = (value, locale, fallback = "") => {
7394
7396
  };
7395
7397
  //#endregion
7396
7398
  //#region src/order/fees.ts
7397
- /** Root FEE line whose `metadata.fee_based_on` is a delivery/shipping basis. */
7399
+ /** Root FEE line that is a delivery/shipping fee. */
7398
7400
  const isShippingFeeLine = (line) => {
7399
7401
  return line.parent_uid == null && isDeliveryFee(line);
7400
7402
  };
@@ -7629,7 +7631,11 @@ const sumMoney = (parts) => {
7629
7631
  };
7630
7632
  const toFeeLine = (fee, money, locale, redeem = []) => {
7631
7633
  const name = feeName(fee.name, locale);
7632
- const metadata = { fee_based_on: requiredEffects(fee)[0]?.based_on ?? null };
7634
+ const required = requiredEffects(fee);
7635
+ const fee_based_on = required[0]?.based_on ?? null;
7636
+ const isShipping = required.some((effect) => effect.shipping === true);
7637
+ const metadata = { fee_based_on };
7638
+ if (isShipping) metadata.fee_shipping = true;
7633
7639
  const u = money.unit_subtotal;
7634
7640
  const d = 0;
7635
7641
  const tax = money.unit_tax_total;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fire-spark/core",
3
- "version": "0.38.7",
3
+ "version": "0.40.0",
4
4
  "description": "Fire Spark headless SDK",
5
5
  "type": "module",
6
6
  "sideEffects": false,
@@ -20,8 +20,8 @@
20
20
  "big.js": "6.2.1",
21
21
  "dayjs": "1.11.9",
22
22
  "@types/big.js": "6.2.2",
23
- "@fire-spark/payments": "^0.38.7",
24
- "@fire-spark/types": "^0.38.7"
23
+ "@fire-spark/payments": "^0.40.0",
24
+ "@fire-spark/types": "^0.40.0"
25
25
  },
26
26
  "devDependencies": {
27
27
  "tsdown": "^0.22.14",