@fire-spark/core 0.12.3 → 0.12.4

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.
Files changed (2) hide show
  1. package/dist/index.js +10 -1
  2. package/package.json +3 -3
package/dist/index.js CHANGED
@@ -3934,11 +3934,20 @@ const redemptionTenderInputs = (redeem, providers = /* @__PURE__ */ new Map()) =
3934
3934
  };
3935
3935
  });
3936
3936
  };
3937
+ /**
3938
+ * `collect_at` when the caller omits it, same rule as the API place
3939
+ * default (D23): cash and the Fire Spark card terminal are collected in
3940
+ * person (`DOOR`); every other method is charged by the SDK (`DEVICE`).
3941
+ */
3942
+ const defaultTenderCollectAt = (provider, method) => {
3943
+ return isManualPayment(provider, method) ? "DOOR" : "DEVICE";
3944
+ };
3937
3945
  /** The one real tender of the simple flow (`allocation: null`). */
3938
3946
  const simpleTenderInput = (payment) => {
3939
3947
  if (!payment.type || !payment.provider) return null;
3940
3948
  if (!isRealPaymentMethod(payment.type)) return null;
3941
- const collect_at = payment.collect_at ?? "DEVICE";
3949
+ const fallback = defaultTenderCollectAt(payment.provider, payment.type);
3950
+ const collect_at = payment.collect_at ?? fallback;
3942
3951
  const t1 = {
3943
3952
  method: payment.type,
3944
3953
  provider: payment.provider
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fire-spark/core",
3
- "version": "0.12.3",
3
+ "version": "0.12.4",
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.12.3",
24
- "@fire-spark/types": "^0.12.3"
23
+ "@fire-spark/payments": "^0.12.4",
24
+ "@fire-spark/types": "^0.12.4"
25
25
  },
26
26
  "devDependencies": {
27
27
  "tsdown": "^0.22.14",