@invonetwork/web-sdk 3.3.0 → 3.6.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.
@@ -246,6 +246,121 @@ var InvoError = class _InvoError extends Error {
246
246
  get isSteamPurchaseLayerRequired() {
247
247
  return this.code === "STEAM_PURCHASE_LAYER_REQUIRED";
248
248
  }
249
+ /**
250
+ * True if the title has no Steam application registered with INVO yet
251
+ * (`STEAM_NOT_CONFIGURED`, 503).
252
+ *
253
+ * Steam pays whoever owns the Steam app, so every INVO title bills through
254
+ * ITS OWN Steam application. The studio adds their Steam app id and publisher
255
+ * Web API key in the INVO dashboard; until then the rail is closed. Earlier
256
+ * SDK versions said purchases ran through an INVO-owned Steam app and there
257
+ * was nothing to register — that is no longer true.
258
+ *
259
+ * Not retryable; the fix is a setup step in the dashboard.
260
+ */
261
+ get isSteamNotConfigured() {
262
+ return this.code === "STEAM_NOT_CONFIGURED";
263
+ }
264
+ /**
265
+ * True if the order was started against a DIFFERENT Steam application than the
266
+ * title is configured for now (`STEAM_APP_CHANGED`, 409).
267
+ *
268
+ * Happens when a studio swaps their Steam app while orders are in flight. The
269
+ * in-flight order cannot be captured under the new app — contact INVO to
270
+ * settle it. New purchases work normally.
271
+ */
272
+ get isSteamAppChanged() {
273
+ return this.code === "STEAM_APP_CHANGED";
274
+ }
275
+ /**
276
+ * True if the studio has not finished INVO billing setup
277
+ * (`PARTNER_BILLING_NOT_SET_UP`, 409).
278
+ *
279
+ * On Steam, Valve pays the STUDIO and INVO issues the player's currency, so
280
+ * INVO settles with the studio afterwards against a payment method they keep
281
+ * on file. No payment method, no sale. Not retryable; it is a dashboard step.
282
+ */
283
+ get isPartnerBillingNotSetUp() {
284
+ return this.code === "PARTNER_BILLING_NOT_SET_UP";
285
+ }
286
+ /**
287
+ * True if the studio's settlement has been suspended (`PARTNER_RAIL_SUSPENDED`,
288
+ * 409) or they are temporarily over their settlement limit
289
+ * (`PARTNER_CREDIT_UNAVAILABLE`, 409).
290
+ *
291
+ * Refused BEFORE the player is charged, which is deliberate — the alternative
292
+ * is taking their money for currency that cannot be issued. Show a neutral
293
+ * "purchases are unavailable right now"; do not surface it as the player's
294
+ * problem, because it is not.
295
+ */
296
+ get isPartnerSettlementUnavailable() {
297
+ return this.code === "PARTNER_RAIL_SUSPENDED" || this.code === "PARTNER_CREDIT_UNAVAILABLE";
298
+ }
299
+ /** True when the studio's settlement float cannot cover this purchase right
300
+ * now (`PARTNER_CREDIT_UNAVAILABLE`, 409) — the structure (billing profile,
301
+ * mandate, payment method) is in place; the MONEY is not. Fixed by the
302
+ * studio topping up (or a settlement sweep clearing), not by the player.
303
+ * Show a plain failure ("try again later"); do NOT hot-poll init — headroom
304
+ * changes on a human action, and each retry briefly re-reserves headroom.
305
+ * A manual retry MUST reuse the same purchaseReference. */
306
+ get isPartnerCreditUnavailable() {
307
+ return this.code === "PARTNER_CREDIT_UNAVAILABLE";
308
+ }
309
+ /** True when the studio's settlement rail is suspended
310
+ * (`PARTNER_RAIL_SUSPENDED`, 409) — collections failed repeatedly or an
311
+ * admin intervened. Terminal from the game's seat: no retry can succeed
312
+ * until the studio resolves it in the INVO console. */
313
+ get isPartnerRailSuspended() {
314
+ return this.code === "PARTNER_RAIL_SUSPENDED";
315
+ }
316
+ /** True when init-purchase was given a `packId` that is not in INVO's Steam
317
+ * catalogue (`UNKNOWN_STEAM_PACK`, 400). The error body's
318
+ * `valid_pack_ids` lists what exists; re-fetch `steamPacks()` — the
319
+ * catalogue is INVO's and can change without a deploy on your side. */
320
+ get isUnknownSteamPack() {
321
+ return this.code === "UNKNOWN_STEAM_PACK";
322
+ }
323
+ /** True when a web-session init was sent without the player's IP
324
+ * (`MISSING_PLAYER_IP`, 400). Always an integration bug: `playerIp` is
325
+ * required for `usersession: "web"` and must be the PLAYER's address as
326
+ * your server sees it — never your server's own. */
327
+ get isMissingPlayerIp() {
328
+ return this.code === "MISSING_PLAYER_IP";
329
+ }
330
+ /** True when finalize was called before the player approved the charge
331
+ * (409, `status: "not_authorized"` with Steam still reporting `Init`, or
332
+ * no status yet). THE NORMAL WAIT STATE — keep polling / wait for the
333
+ * client callback and call finalize again. Contrast
334
+ * {@link isSteamAuthorizationDead}.
335
+ *
336
+ * PENDING IS THE CLOSED SET, deliberately. The first version of this pair
337
+ * enumerated the DEAD statuses and made pending the complement — so a
338
+ * player pressing Cancel in the overlay (the most common non-approval
339
+ * outcome, which Steam reports as a status the list did not name)
340
+ * classified as "keep polling forever": the exact failure these getters
341
+ * exist to prevent, reintroduced by enumerating the author's hazards
342
+ * instead of the backend's vocabulary. Only `Init` (and an absent status)
343
+ * can mean "not yet"; every named status that is not Init is an outcome. */
344
+ get isSteamAuthorizationPending() {
345
+ const b = this.body;
346
+ if (!b || b["status"] !== "not_authorized") return false;
347
+ const st = String(b["steam_status"] ?? "").toLowerCase();
348
+ return st === "init" || st === "";
349
+ }
350
+ /** True when finalize reports the Steam transaction TERMINALLY not-approved:
351
+ * `not_authorized` with any settled status — Failed, Cancelled, Refunded,
352
+ * Chargedback, and every other non-Init outcome. STOP polling: no later
353
+ * call can succeed. (Dead is the open set on purpose: an unrecognised new
354
+ * status stops a poller rather than trapping it, and stopping wrongly costs
355
+ * one support question while polling wrongly runs forever.) A finalize
356
+ * answering `"Order is not finalizable"` with no `not_authorized` status is
357
+ * equally terminal — the reconciler has already settled the order's fate. */
358
+ get isSteamAuthorizationDead() {
359
+ const b = this.body;
360
+ if (!b || b["status"] !== "not_authorized") return false;
361
+ const st = String(b["steam_status"] ?? "").toLowerCase();
362
+ return st !== "init" && st !== "";
363
+ }
249
364
  /** True if a Platform Commerce CARD purchase was below the processor's floor of $0.50
250
365
  * (backend code `BELOW_STRIPE_MINIMUM`, 400). Neutral name; matches the wire code. */
251
366
  get isBelowCardMinimum() {
@@ -544,5 +659,5 @@ function toDestinationsResult(raw, direction) {
544
659
  }
545
660
 
546
661
  export { Http, InvoError, assertSecureBaseUrl, toDestinationsResult };
547
- //# sourceMappingURL=chunk-ZLPMCR5Q.js.map
548
- //# sourceMappingURL=chunk-ZLPMCR5Q.js.map
662
+ //# sourceMappingURL=chunk-MBKE6ULW.js.map
663
+ //# sourceMappingURL=chunk-MBKE6ULW.js.map