@invonetwork/web-sdk 3.2.3 → 3.5.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.
@@ -212,6 +212,95 @@ declare class InvoError extends Error {
212
212
  * Steam purchase flow. Not retryable on the same rail.
213
213
  */
214
214
  get isSteamPurchaseLayerRequired(): boolean;
215
+ /**
216
+ * True if the title has no Steam application registered with INVO yet
217
+ * (`STEAM_NOT_CONFIGURED`, 503).
218
+ *
219
+ * Steam pays whoever owns the Steam app, so every INVO title bills through
220
+ * ITS OWN Steam application. The studio adds their Steam app id and publisher
221
+ * Web API key in the INVO dashboard; until then the rail is closed. Earlier
222
+ * SDK versions said purchases ran through an INVO-owned Steam app and there
223
+ * was nothing to register — that is no longer true.
224
+ *
225
+ * Not retryable; the fix is a setup step in the dashboard.
226
+ */
227
+ get isSteamNotConfigured(): boolean;
228
+ /**
229
+ * True if the order was started against a DIFFERENT Steam application than the
230
+ * title is configured for now (`STEAM_APP_CHANGED`, 409).
231
+ *
232
+ * Happens when a studio swaps their Steam app while orders are in flight. The
233
+ * in-flight order cannot be captured under the new app — contact INVO to
234
+ * settle it. New purchases work normally.
235
+ */
236
+ get isSteamAppChanged(): boolean;
237
+ /**
238
+ * True if the studio has not finished INVO billing setup
239
+ * (`PARTNER_BILLING_NOT_SET_UP`, 409).
240
+ *
241
+ * On Steam, Valve pays the STUDIO and INVO issues the player's currency, so
242
+ * INVO settles with the studio afterwards against a payment method they keep
243
+ * on file. No payment method, no sale. Not retryable; it is a dashboard step.
244
+ */
245
+ get isPartnerBillingNotSetUp(): boolean;
246
+ /**
247
+ * True if the studio's settlement has been suspended (`PARTNER_RAIL_SUSPENDED`,
248
+ * 409) or they are temporarily over their settlement limit
249
+ * (`PARTNER_CREDIT_UNAVAILABLE`, 409).
250
+ *
251
+ * Refused BEFORE the player is charged, which is deliberate — the alternative
252
+ * is taking their money for currency that cannot be issued. Show a neutral
253
+ * "purchases are unavailable right now"; do not surface it as the player's
254
+ * problem, because it is not.
255
+ */
256
+ get isPartnerSettlementUnavailable(): boolean;
257
+ /** True when the studio's settlement float cannot cover this purchase right
258
+ * now (`PARTNER_CREDIT_UNAVAILABLE`, 409) — the structure (billing profile,
259
+ * mandate, payment method) is in place; the MONEY is not. Fixed by the
260
+ * studio topping up (or a settlement sweep clearing), not by the player.
261
+ * Show a plain failure ("try again later"); do NOT hot-poll init — headroom
262
+ * changes on a human action, and each retry briefly re-reserves headroom.
263
+ * A manual retry MUST reuse the same purchaseReference. */
264
+ get isPartnerCreditUnavailable(): boolean;
265
+ /** True when the studio's settlement rail is suspended
266
+ * (`PARTNER_RAIL_SUSPENDED`, 409) — collections failed repeatedly or an
267
+ * admin intervened. Terminal from the game's seat: no retry can succeed
268
+ * until the studio resolves it in the INVO console. */
269
+ get isPartnerRailSuspended(): boolean;
270
+ /** True when init-purchase was given a `packId` that is not in INVO's Steam
271
+ * catalogue (`UNKNOWN_STEAM_PACK`, 400). The error body's
272
+ * `valid_pack_ids` lists what exists; re-fetch `steamPacks()` — the
273
+ * catalogue is INVO's and can change without a deploy on your side. */
274
+ get isUnknownSteamPack(): boolean;
275
+ /** True when a web-session init was sent without the player's IP
276
+ * (`MISSING_PLAYER_IP`, 400). Always an integration bug: `playerIp` is
277
+ * required for `usersession: "web"` and must be the PLAYER's address as
278
+ * your server sees it — never your server's own. */
279
+ get isMissingPlayerIp(): boolean;
280
+ /** True when finalize was called before the player approved the charge
281
+ * (409, `status: "not_authorized"` with Steam still reporting `Init`, or
282
+ * no status yet). THE NORMAL WAIT STATE — keep polling / wait for the
283
+ * client callback and call finalize again. Contrast
284
+ * {@link isSteamAuthorizationDead}.
285
+ *
286
+ * PENDING IS THE CLOSED SET, deliberately. The first version of this pair
287
+ * enumerated the DEAD statuses and made pending the complement — so a
288
+ * player pressing Cancel in the overlay (the most common non-approval
289
+ * outcome, which Steam reports as a status the list did not name)
290
+ * classified as "keep polling forever": the exact failure these getters
291
+ * exist to prevent, reintroduced by enumerating the author's hazards
292
+ * instead of the backend's vocabulary. Only `Init` (and an absent status)
293
+ * can mean "not yet"; every named status that is not Init is an outcome. */
294
+ get isSteamAuthorizationPending(): boolean;
295
+ /** True when finalize reports the Steam transaction TERMINALLY not-approved:
296
+ * `not_authorized` with any settled status — Failed, Cancelled, Refunded,
297
+ * Chargedback, and every other non-Init outcome. STOP polling: no later
298
+ * call can succeed. (Dead is the open set on purpose: an unrecognised new
299
+ * status stops a poller rather than trapping it, and stopping wrongly costs
300
+ * one support question while polling wrongly runs forever.) A finalize
301
+ * answering `"Order is not finalizable"` with no `not_authorized` status is
302
+ * equally terminal — the reconciler has already settled the order's fate. */
303
+ get isSteamAuthorizationDead(): boolean;
215
304
  /** True if a Platform Commerce CARD purchase was below the processor's floor of $0.50
216
305
  * (backend code `BELOW_STRIPE_MINIMUM`, 400). Neutral name; matches the wire code. */
217
306
  get isBelowCardMinimum(): boolean;
@@ -472,6 +561,113 @@ interface ItemHistoryResult {
472
561
  pagination: Record<string, unknown>;
473
562
  raw: Record<string, unknown>;
474
563
  }
564
+ /**
565
+ * How the player will authorize the Steam charge.
566
+ *
567
+ * - `"client"` (default): the Steam overlay pops inside the running game and
568
+ * your client receives `MicroTxnAuthorizationResponse`. Requires the overlay
569
+ * to actually render — it does NOT in some embedded/Electron builds
570
+ * (observed: macOS), where this mode simply never completes.
571
+ * - `"web"`: INVO returns `steamCheckoutUrl` — Steam's own hosted approval
572
+ * page. Open it as a TOP-LEVEL browser tab/window, never an iframe (the
573
+ * page cannot be framed). Requires `playerIp`.
574
+ */
575
+ type SteamUserSession = "client" | "web";
576
+ interface SteamPack {
577
+ packId: string;
578
+ label: string;
579
+ /** Sticker price, USD, as a string — identical for every player. */
580
+ priceUsd: string;
581
+ /**
582
+ * The branded currency THIS pack yields for THIS player, as a string.
583
+ * Varies by country (Steam prices are VAT-inclusive; VAT and the
584
+ * storefront's revenue share come out before currency is derived), so render
585
+ * it verbatim — NEVER compute currency from the sticker price, and never
586
+ * cache one answer for all players.
587
+ */
588
+ currencyAmount: string;
589
+ }
590
+ interface SteamPacksQuery {
591
+ /**
592
+ * The player's 64-bit Steam id. Optional: without it amounts are quoted with
593
+ * no VAT deducted (the most any pack yields); the purchase itself always
594
+ * re-derives from the country Steam actually reports.
595
+ */
596
+ steamid?: string;
597
+ }
598
+ interface SteamPacksResult {
599
+ packs: SteamPack[];
600
+ /** ISO country Steam reported for the player, or null when unknown. */
601
+ country: string | null;
602
+ /** VAT rate (percent, string) the quote used. "0" when none applies. */
603
+ vatRatePct: string;
604
+ raw: Record<string, unknown>;
605
+ }
606
+ interface SteamInitPurchaseInput {
607
+ playerEmail: string;
608
+ /** The purchasing player's 64-bit Steam id (digits). */
609
+ steamid: string;
610
+ /** From `steamPacks()`. You never send a price — INVO sets Steam pricing. */
611
+ packId: string;
612
+ /**
613
+ * Idempotency key, unique per INTENDED purchase. Required. Resending the
614
+ * same reference returns the same order and never double-charges; retries —
615
+ * including manual retries after a 409 — MUST reuse it.
616
+ */
617
+ purchaseReference: string;
618
+ /** Default "client". See {@link SteamUserSession}. */
619
+ usersession?: SteamUserSession;
620
+ /**
621
+ * REQUIRED when `usersession` is "web": the PLAYER's IP address as your
622
+ * server sees it. Never your server's own address — Steam runs fraud and
623
+ * geolocation checks against it.
624
+ */
625
+ playerIp?: string;
626
+ playerName?: string;
627
+ /** Echoed back verbatim on the purchase.completed webhook (data.metadata). */
628
+ metadata?: Record<string, unknown>;
629
+ }
630
+ interface SteamInitPurchaseResult {
631
+ /** "pending_authorization" — the player has not approved yet. */
632
+ status: string;
633
+ /** INVO's order id. Keep it: finalize takes exactly this. */
634
+ orderId: string;
635
+ /** Steam's transaction id, for your own logs/support. */
636
+ steamTransid?: string;
637
+ /**
638
+ * Present ONLY for `usersession: "web"`: Steam's hosted approval page. Open
639
+ * as a TOP-LEVEL tab/window — it cannot be iframed.
640
+ */
641
+ steamCheckoutUrl?: string;
642
+ packId?: string;
643
+ /** What Steam will charge the player (USD, string). */
644
+ chargedUsd?: string;
645
+ /** The branded currency the player will receive on finalize. */
646
+ currencyAmount?: string;
647
+ raw: Record<string, unknown>;
648
+ }
649
+ interface SteamFinalizeInput {
650
+ /** The `orderId` from {@link SteamInitPurchaseResult}. */
651
+ orderId: string;
652
+ }
653
+ interface SteamFinalizeResult {
654
+ /** "success" once captured and credited. */
655
+ status: string;
656
+ orderId?: string;
657
+ transactionId?: string;
658
+ /** Canonical balance AFTER the credit. */
659
+ newBalance?: string | number | null;
660
+ /**
661
+ * True when this call was an idempotent replay of an order already credited.
662
+ * The replay body carries NO balance — `newBalance` is null here; read the
663
+ * balance from the original success, or from `playerBalance()` if you need
664
+ * it fresh. (Documented wrong as "the current balance" until the audit
665
+ * checked the replay body against the backend, which returns only
666
+ * status/order/transaction ids.)
667
+ */
668
+ alreadyProcessed: boolean;
669
+ raw: Record<string, unknown>;
670
+ }
475
671
  interface PurchaseItemInput {
476
672
  /** Idempotency key, unique per game. Required. A duplicate returns 409. */
477
673
  clientRequestId: string;
@@ -989,4 +1185,4 @@ interface PhoneShareStatusResult {
989
1185
  raw: Record<string, unknown>;
990
1186
  }
991
1187
 
992
- export { type LinkedIdentitiesResult as $, type ApproveResult as A, type BalanceResult as B, type CheckoutMountHandle as C, type DestinationsQuery as D, type EnrollmentBeginResult as E, type PurchaseInput as F, type PurchaseResult as G, Http as H, InvoError as I, type ConfirmPaymentResult as J, type PurchaseItemInput as K, type LinkDeviceResult as L, type MountCheckoutOptions as M, type PurchaseItemResult as N, type OrderDetailsResult as O, type PendingCollectResult as P, type ItemHistoryQuery as Q, type RecoveryBeginResult as R, type ServerConfig as S, type ItemHistoryResult as T, type ItemOrderQuery as U, type VerificationMethod as V, type PlayerBalanceQuery as W, type PlayerBalanceResult as X, type InboundPendingQuery as Y, type InboundPendingResult as Z, type LinkedIdentitiesQuery as _, type ClientConfig as a, type SmsVerifyResult as a0, type ClaimTransferInput as a1, type ClaimResult as a2, type ClaimCurrencyInput as a3, type TransactionStatusResult as a4, type GuardianApprovalStatusResult as a5, type ServerDestinationsQuery as a6, type PhoneShareContact as a7, type PhoneShareInitiateResult as a8, type PhoneShareApproveInput as a9, type PhoneShareApproveResult as aa, type PhoneShareStatusResult as ab, type CurrencyBalance as ac, type FundingSource as ad, type InboundPendingItem as ae, type LinkedIdentityEmail as af, type PlatformPurchaseStatus as ag, type CallOptions as b, type ConfirmReceiptResult as c, type DestinationsResult as d, type EnrollmentVerifyResult as e, type RecoveryCompleteResult as f, type BalanceRow as g, type DestinationGame as h, type InvoErrorInfo as i, type InvoHooks as j, type InvoRequestInfo as k, type InvoResponseInfo as l, type PendingCollectItem as m, type Rail as n, type AuthHeader as o, type PlatformPurchaseInput as p, type PlatformPurchaseResult as q, type PlatformOrderStatusResult as r, type PlatformRefundInput as s, type PlatformRefundResult as t, type PlayerToken as u, type InitiateSendInput as v, type InitiateResult as w, type InitiateTransferInput as x, type CreateCheckoutInput as y, type CreateCheckoutResult as z };
1188
+ export { type ItemOrderQuery as $, type ApproveResult as A, type BalanceResult as B, type CheckoutMountHandle as C, type DestinationsQuery as D, type EnrollmentBeginResult as E, type PurchaseInput as F, type PurchaseResult as G, Http as H, InvoError as I, type ConfirmPaymentResult as J, type SteamPacksQuery as K, type LinkDeviceResult as L, type MountCheckoutOptions as M, type SteamPacksResult as N, type OrderDetailsResult as O, type PendingCollectResult as P, type SteamInitPurchaseInput as Q, type RecoveryBeginResult as R, type ServerConfig as S, type SteamInitPurchaseResult as T, type SteamFinalizeInput as U, type VerificationMethod as V, type SteamFinalizeResult as W, type PurchaseItemInput as X, type PurchaseItemResult as Y, type ItemHistoryQuery as Z, type ItemHistoryResult as _, type ClientConfig as a, type PlayerBalanceQuery as a0, type PlayerBalanceResult as a1, type InboundPendingQuery as a2, type InboundPendingResult as a3, type LinkedIdentitiesQuery as a4, type LinkedIdentitiesResult as a5, type SmsVerifyResult as a6, type ClaimTransferInput as a7, type ClaimResult as a8, type ClaimCurrencyInput as a9, type TransactionStatusResult as aa, type GuardianApprovalStatusResult as ab, type ServerDestinationsQuery as ac, type PhoneShareContact as ad, type PhoneShareInitiateResult as ae, type PhoneShareApproveInput as af, type PhoneShareApproveResult as ag, type PhoneShareStatusResult as ah, type CurrencyBalance as ai, type FundingSource as aj, type InboundPendingItem as ak, type LinkedIdentityEmail as al, type PlatformPurchaseStatus as am, type SteamPack as an, type SteamUserSession as ao, type CallOptions as b, type ConfirmReceiptResult as c, type DestinationsResult as d, type EnrollmentVerifyResult as e, type RecoveryCompleteResult as f, type BalanceRow as g, type DestinationGame as h, type InvoErrorInfo as i, type InvoHooks as j, type InvoRequestInfo as k, type InvoResponseInfo as l, type PendingCollectItem as m, type Rail as n, type AuthHeader as o, type PlatformPurchaseInput as p, type PlatformPurchaseResult as q, type PlatformOrderStatusResult as r, type PlatformRefundInput as s, type PlatformRefundResult as t, type PlayerToken as u, type InitiateSendInput as v, type InitiateResult as w, type InitiateTransferInput as x, type CreateCheckoutInput as y, type CreateCheckoutResult as z };
@@ -212,6 +212,95 @@ declare class InvoError extends Error {
212
212
  * Steam purchase flow. Not retryable on the same rail.
213
213
  */
214
214
  get isSteamPurchaseLayerRequired(): boolean;
215
+ /**
216
+ * True if the title has no Steam application registered with INVO yet
217
+ * (`STEAM_NOT_CONFIGURED`, 503).
218
+ *
219
+ * Steam pays whoever owns the Steam app, so every INVO title bills through
220
+ * ITS OWN Steam application. The studio adds their Steam app id and publisher
221
+ * Web API key in the INVO dashboard; until then the rail is closed. Earlier
222
+ * SDK versions said purchases ran through an INVO-owned Steam app and there
223
+ * was nothing to register — that is no longer true.
224
+ *
225
+ * Not retryable; the fix is a setup step in the dashboard.
226
+ */
227
+ get isSteamNotConfigured(): boolean;
228
+ /**
229
+ * True if the order was started against a DIFFERENT Steam application than the
230
+ * title is configured for now (`STEAM_APP_CHANGED`, 409).
231
+ *
232
+ * Happens when a studio swaps their Steam app while orders are in flight. The
233
+ * in-flight order cannot be captured under the new app — contact INVO to
234
+ * settle it. New purchases work normally.
235
+ */
236
+ get isSteamAppChanged(): boolean;
237
+ /**
238
+ * True if the studio has not finished INVO billing setup
239
+ * (`PARTNER_BILLING_NOT_SET_UP`, 409).
240
+ *
241
+ * On Steam, Valve pays the STUDIO and INVO issues the player's currency, so
242
+ * INVO settles with the studio afterwards against a payment method they keep
243
+ * on file. No payment method, no sale. Not retryable; it is a dashboard step.
244
+ */
245
+ get isPartnerBillingNotSetUp(): boolean;
246
+ /**
247
+ * True if the studio's settlement has been suspended (`PARTNER_RAIL_SUSPENDED`,
248
+ * 409) or they are temporarily over their settlement limit
249
+ * (`PARTNER_CREDIT_UNAVAILABLE`, 409).
250
+ *
251
+ * Refused BEFORE the player is charged, which is deliberate — the alternative
252
+ * is taking their money for currency that cannot be issued. Show a neutral
253
+ * "purchases are unavailable right now"; do not surface it as the player's
254
+ * problem, because it is not.
255
+ */
256
+ get isPartnerSettlementUnavailable(): boolean;
257
+ /** True when the studio's settlement float cannot cover this purchase right
258
+ * now (`PARTNER_CREDIT_UNAVAILABLE`, 409) — the structure (billing profile,
259
+ * mandate, payment method) is in place; the MONEY is not. Fixed by the
260
+ * studio topping up (or a settlement sweep clearing), not by the player.
261
+ * Show a plain failure ("try again later"); do NOT hot-poll init — headroom
262
+ * changes on a human action, and each retry briefly re-reserves headroom.
263
+ * A manual retry MUST reuse the same purchaseReference. */
264
+ get isPartnerCreditUnavailable(): boolean;
265
+ /** True when the studio's settlement rail is suspended
266
+ * (`PARTNER_RAIL_SUSPENDED`, 409) — collections failed repeatedly or an
267
+ * admin intervened. Terminal from the game's seat: no retry can succeed
268
+ * until the studio resolves it in the INVO console. */
269
+ get isPartnerRailSuspended(): boolean;
270
+ /** True when init-purchase was given a `packId` that is not in INVO's Steam
271
+ * catalogue (`UNKNOWN_STEAM_PACK`, 400). The error body's
272
+ * `valid_pack_ids` lists what exists; re-fetch `steamPacks()` — the
273
+ * catalogue is INVO's and can change without a deploy on your side. */
274
+ get isUnknownSteamPack(): boolean;
275
+ /** True when a web-session init was sent without the player's IP
276
+ * (`MISSING_PLAYER_IP`, 400). Always an integration bug: `playerIp` is
277
+ * required for `usersession: "web"` and must be the PLAYER's address as
278
+ * your server sees it — never your server's own. */
279
+ get isMissingPlayerIp(): boolean;
280
+ /** True when finalize was called before the player approved the charge
281
+ * (409, `status: "not_authorized"` with Steam still reporting `Init`, or
282
+ * no status yet). THE NORMAL WAIT STATE — keep polling / wait for the
283
+ * client callback and call finalize again. Contrast
284
+ * {@link isSteamAuthorizationDead}.
285
+ *
286
+ * PENDING IS THE CLOSED SET, deliberately. The first version of this pair
287
+ * enumerated the DEAD statuses and made pending the complement — so a
288
+ * player pressing Cancel in the overlay (the most common non-approval
289
+ * outcome, which Steam reports as a status the list did not name)
290
+ * classified as "keep polling forever": the exact failure these getters
291
+ * exist to prevent, reintroduced by enumerating the author's hazards
292
+ * instead of the backend's vocabulary. Only `Init` (and an absent status)
293
+ * can mean "not yet"; every named status that is not Init is an outcome. */
294
+ get isSteamAuthorizationPending(): boolean;
295
+ /** True when finalize reports the Steam transaction TERMINALLY not-approved:
296
+ * `not_authorized` with any settled status — Failed, Cancelled, Refunded,
297
+ * Chargedback, and every other non-Init outcome. STOP polling: no later
298
+ * call can succeed. (Dead is the open set on purpose: an unrecognised new
299
+ * status stops a poller rather than trapping it, and stopping wrongly costs
300
+ * one support question while polling wrongly runs forever.) A finalize
301
+ * answering `"Order is not finalizable"` with no `not_authorized` status is
302
+ * equally terminal — the reconciler has already settled the order's fate. */
303
+ get isSteamAuthorizationDead(): boolean;
215
304
  /** True if a Platform Commerce CARD purchase was below the processor's floor of $0.50
216
305
  * (backend code `BELOW_STRIPE_MINIMUM`, 400). Neutral name; matches the wire code. */
217
306
  get isBelowCardMinimum(): boolean;
@@ -472,6 +561,113 @@ interface ItemHistoryResult {
472
561
  pagination: Record<string, unknown>;
473
562
  raw: Record<string, unknown>;
474
563
  }
564
+ /**
565
+ * How the player will authorize the Steam charge.
566
+ *
567
+ * - `"client"` (default): the Steam overlay pops inside the running game and
568
+ * your client receives `MicroTxnAuthorizationResponse`. Requires the overlay
569
+ * to actually render — it does NOT in some embedded/Electron builds
570
+ * (observed: macOS), where this mode simply never completes.
571
+ * - `"web"`: INVO returns `steamCheckoutUrl` — Steam's own hosted approval
572
+ * page. Open it as a TOP-LEVEL browser tab/window, never an iframe (the
573
+ * page cannot be framed). Requires `playerIp`.
574
+ */
575
+ type SteamUserSession = "client" | "web";
576
+ interface SteamPack {
577
+ packId: string;
578
+ label: string;
579
+ /** Sticker price, USD, as a string — identical for every player. */
580
+ priceUsd: string;
581
+ /**
582
+ * The branded currency THIS pack yields for THIS player, as a string.
583
+ * Varies by country (Steam prices are VAT-inclusive; VAT and the
584
+ * storefront's revenue share come out before currency is derived), so render
585
+ * it verbatim — NEVER compute currency from the sticker price, and never
586
+ * cache one answer for all players.
587
+ */
588
+ currencyAmount: string;
589
+ }
590
+ interface SteamPacksQuery {
591
+ /**
592
+ * The player's 64-bit Steam id. Optional: without it amounts are quoted with
593
+ * no VAT deducted (the most any pack yields); the purchase itself always
594
+ * re-derives from the country Steam actually reports.
595
+ */
596
+ steamid?: string;
597
+ }
598
+ interface SteamPacksResult {
599
+ packs: SteamPack[];
600
+ /** ISO country Steam reported for the player, or null when unknown. */
601
+ country: string | null;
602
+ /** VAT rate (percent, string) the quote used. "0" when none applies. */
603
+ vatRatePct: string;
604
+ raw: Record<string, unknown>;
605
+ }
606
+ interface SteamInitPurchaseInput {
607
+ playerEmail: string;
608
+ /** The purchasing player's 64-bit Steam id (digits). */
609
+ steamid: string;
610
+ /** From `steamPacks()`. You never send a price — INVO sets Steam pricing. */
611
+ packId: string;
612
+ /**
613
+ * Idempotency key, unique per INTENDED purchase. Required. Resending the
614
+ * same reference returns the same order and never double-charges; retries —
615
+ * including manual retries after a 409 — MUST reuse it.
616
+ */
617
+ purchaseReference: string;
618
+ /** Default "client". See {@link SteamUserSession}. */
619
+ usersession?: SteamUserSession;
620
+ /**
621
+ * REQUIRED when `usersession` is "web": the PLAYER's IP address as your
622
+ * server sees it. Never your server's own address — Steam runs fraud and
623
+ * geolocation checks against it.
624
+ */
625
+ playerIp?: string;
626
+ playerName?: string;
627
+ /** Echoed back verbatim on the purchase.completed webhook (data.metadata). */
628
+ metadata?: Record<string, unknown>;
629
+ }
630
+ interface SteamInitPurchaseResult {
631
+ /** "pending_authorization" — the player has not approved yet. */
632
+ status: string;
633
+ /** INVO's order id. Keep it: finalize takes exactly this. */
634
+ orderId: string;
635
+ /** Steam's transaction id, for your own logs/support. */
636
+ steamTransid?: string;
637
+ /**
638
+ * Present ONLY for `usersession: "web"`: Steam's hosted approval page. Open
639
+ * as a TOP-LEVEL tab/window — it cannot be iframed.
640
+ */
641
+ steamCheckoutUrl?: string;
642
+ packId?: string;
643
+ /** What Steam will charge the player (USD, string). */
644
+ chargedUsd?: string;
645
+ /** The branded currency the player will receive on finalize. */
646
+ currencyAmount?: string;
647
+ raw: Record<string, unknown>;
648
+ }
649
+ interface SteamFinalizeInput {
650
+ /** The `orderId` from {@link SteamInitPurchaseResult}. */
651
+ orderId: string;
652
+ }
653
+ interface SteamFinalizeResult {
654
+ /** "success" once captured and credited. */
655
+ status: string;
656
+ orderId?: string;
657
+ transactionId?: string;
658
+ /** Canonical balance AFTER the credit. */
659
+ newBalance?: string | number | null;
660
+ /**
661
+ * True when this call was an idempotent replay of an order already credited.
662
+ * The replay body carries NO balance — `newBalance` is null here; read the
663
+ * balance from the original success, or from `playerBalance()` if you need
664
+ * it fresh. (Documented wrong as "the current balance" until the audit
665
+ * checked the replay body against the backend, which returns only
666
+ * status/order/transaction ids.)
667
+ */
668
+ alreadyProcessed: boolean;
669
+ raw: Record<string, unknown>;
670
+ }
475
671
  interface PurchaseItemInput {
476
672
  /** Idempotency key, unique per game. Required. A duplicate returns 409. */
477
673
  clientRequestId: string;
@@ -989,4 +1185,4 @@ interface PhoneShareStatusResult {
989
1185
  raw: Record<string, unknown>;
990
1186
  }
991
1187
 
992
- export { type LinkedIdentitiesResult as $, type ApproveResult as A, type BalanceResult as B, type CheckoutMountHandle as C, type DestinationsQuery as D, type EnrollmentBeginResult as E, type PurchaseInput as F, type PurchaseResult as G, Http as H, InvoError as I, type ConfirmPaymentResult as J, type PurchaseItemInput as K, type LinkDeviceResult as L, type MountCheckoutOptions as M, type PurchaseItemResult as N, type OrderDetailsResult as O, type PendingCollectResult as P, type ItemHistoryQuery as Q, type RecoveryBeginResult as R, type ServerConfig as S, type ItemHistoryResult as T, type ItemOrderQuery as U, type VerificationMethod as V, type PlayerBalanceQuery as W, type PlayerBalanceResult as X, type InboundPendingQuery as Y, type InboundPendingResult as Z, type LinkedIdentitiesQuery as _, type ClientConfig as a, type SmsVerifyResult as a0, type ClaimTransferInput as a1, type ClaimResult as a2, type ClaimCurrencyInput as a3, type TransactionStatusResult as a4, type GuardianApprovalStatusResult as a5, type ServerDestinationsQuery as a6, type PhoneShareContact as a7, type PhoneShareInitiateResult as a8, type PhoneShareApproveInput as a9, type PhoneShareApproveResult as aa, type PhoneShareStatusResult as ab, type CurrencyBalance as ac, type FundingSource as ad, type InboundPendingItem as ae, type LinkedIdentityEmail as af, type PlatformPurchaseStatus as ag, type CallOptions as b, type ConfirmReceiptResult as c, type DestinationsResult as d, type EnrollmentVerifyResult as e, type RecoveryCompleteResult as f, type BalanceRow as g, type DestinationGame as h, type InvoErrorInfo as i, type InvoHooks as j, type InvoRequestInfo as k, type InvoResponseInfo as l, type PendingCollectItem as m, type Rail as n, type AuthHeader as o, type PlatformPurchaseInput as p, type PlatformPurchaseResult as q, type PlatformOrderStatusResult as r, type PlatformRefundInput as s, type PlatformRefundResult as t, type PlayerToken as u, type InitiateSendInput as v, type InitiateResult as w, type InitiateTransferInput as x, type CreateCheckoutInput as y, type CreateCheckoutResult as z };
1188
+ export { type ItemOrderQuery as $, type ApproveResult as A, type BalanceResult as B, type CheckoutMountHandle as C, type DestinationsQuery as D, type EnrollmentBeginResult as E, type PurchaseInput as F, type PurchaseResult as G, Http as H, InvoError as I, type ConfirmPaymentResult as J, type SteamPacksQuery as K, type LinkDeviceResult as L, type MountCheckoutOptions as M, type SteamPacksResult as N, type OrderDetailsResult as O, type PendingCollectResult as P, type SteamInitPurchaseInput as Q, type RecoveryBeginResult as R, type ServerConfig as S, type SteamInitPurchaseResult as T, type SteamFinalizeInput as U, type VerificationMethod as V, type SteamFinalizeResult as W, type PurchaseItemInput as X, type PurchaseItemResult as Y, type ItemHistoryQuery as Z, type ItemHistoryResult as _, type ClientConfig as a, type PlayerBalanceQuery as a0, type PlayerBalanceResult as a1, type InboundPendingQuery as a2, type InboundPendingResult as a3, type LinkedIdentitiesQuery as a4, type LinkedIdentitiesResult as a5, type SmsVerifyResult as a6, type ClaimTransferInput as a7, type ClaimResult as a8, type ClaimCurrencyInput as a9, type TransactionStatusResult as aa, type GuardianApprovalStatusResult as ab, type ServerDestinationsQuery as ac, type PhoneShareContact as ad, type PhoneShareInitiateResult as ae, type PhoneShareApproveInput as af, type PhoneShareApproveResult as ag, type PhoneShareStatusResult as ah, type CurrencyBalance as ai, type FundingSource as aj, type InboundPendingItem as ak, type LinkedIdentityEmail as al, type PlatformPurchaseStatus as am, type SteamPack as an, type SteamUserSession as ao, type CallOptions as b, type ConfirmReceiptResult as c, type DestinationsResult as d, type EnrollmentVerifyResult as e, type RecoveryCompleteResult as f, type BalanceRow as g, type DestinationGame as h, type InvoErrorInfo as i, type InvoHooks as j, type InvoRequestInfo as k, type InvoResponseInfo as l, type PendingCollectItem as m, type Rail as n, type AuthHeader as o, type PlatformPurchaseInput as p, type PlatformPurchaseResult as q, type PlatformOrderStatusResult as r, type PlatformRefundInput as s, type PlatformRefundResult as t, type PlayerToken as u, type InitiateSendInput as v, type InitiateResult as w, type InitiateTransferInput as x, type CreateCheckoutInput as y, type CreateCheckoutResult as z };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@invonetwork/web-sdk",
3
- "version": "3.2.3",
3
+ "version": "3.5.0",
4
4
  "description": "INVO Web SDK — currency purchase + passkey (WebAuthn) verification for partner web platforms.",
5
5
  "license": "SEE LICENSE IN LICENSE",
6
6
  "private": false,