@invonetwork/web-sdk 3.8.1 → 3.10.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/CHANGELOG.md +70 -0
- package/LICENSE +18 -18
- package/README.md +176 -51
- package/dist/{chunk-HYGBTUEJ.js → chunk-L4A6OV54.js} +106 -2
- package/dist/index.cjs +104 -0
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +2 -2
- package/dist/server.cjs +307 -61
- package/dist/server.d.cts +216 -37
- package/dist/server.d.ts +216 -37
- package/dist/server.js +204 -63
- package/dist/{types-DqRuqbqI.d.cts → types-CBxpXgAM.d.cts} +273 -15
- package/dist/{types-DqRuqbqI.d.ts → types-CBxpXgAM.d.ts} +273 -15
- package/package.json +1 -1
|
@@ -413,6 +413,55 @@ declare class InvoError extends Error {
|
|
|
413
413
|
* remain refundable in coins.
|
|
414
414
|
*/
|
|
415
415
|
get isSteamRefundNotSupported(): boolean;
|
|
416
|
+
/**
|
|
417
|
+
* True when `subscriptions.refund` was refused because refunds are turned off for this
|
|
418
|
+
* game (`REFUNDS_NOT_ENABLED`, 403). Refunds are on by default for every game; INVO turns
|
|
419
|
+
* them off per game. Contact INVO.
|
|
420
|
+
*/
|
|
421
|
+
get isRefundsNotEnabled(): boolean;
|
|
422
|
+
/**
|
|
423
|
+
* True when `subscriptions.refund` targeted a period charged more than 30 days ago
|
|
424
|
+
* (`REFUND_WINDOW_CLOSED`, 409). See `periodChargedAt`, `refundWindowDays` and
|
|
425
|
+
* `refundWindowClosedAt`. A retry of a refund that already ran still returns its receipt.
|
|
426
|
+
*/
|
|
427
|
+
get isRefundWindowClosed(): boolean;
|
|
428
|
+
/**
|
|
429
|
+
* True when a refund request for this period is waiting for INVO's review
|
|
430
|
+
* (`REFUND_REQUEST_PENDING`, 409). No other refund of the period can run until it is
|
|
431
|
+
* decided. The request id is on `refundRequestId`.
|
|
432
|
+
*/
|
|
433
|
+
get isRefundRequestPending(): boolean;
|
|
434
|
+
/**
|
|
435
|
+
* True when this `clientRequestId` was filed as a refund request and INVO rejected it
|
|
436
|
+
* (`REFUND_REQUEST_REJECTED`, 409). See `refundRequestId` and `decisionReason`. To try
|
|
437
|
+
* again use a NEW `clientRequestId`.
|
|
438
|
+
*/
|
|
439
|
+
get isRefundRequestRejected(): boolean;
|
|
440
|
+
/**
|
|
441
|
+
* True when two requests collided (`CONCURRENT_REQUEST`, 409): two creates for a
|
|
442
|
+
* brand-new player, or two refund requests for one period filed at the same moment.
|
|
443
|
+
* Retry with the SAME key.
|
|
444
|
+
*/
|
|
445
|
+
get isConcurrentRequest(): boolean;
|
|
446
|
+
/**
|
|
447
|
+
* True when a subscription refund needs manual reconciliation (`REFUND_MISMATCH`, 502):
|
|
448
|
+
* the card processor already holds a refund for this request with a different amount, or
|
|
449
|
+
* the charge was already fully refunded outside this flow. Contact INVO; do not retry-loop.
|
|
450
|
+
*/
|
|
451
|
+
get isRefundMismatch(): boolean;
|
|
452
|
+
/**
|
|
453
|
+
* The refund request id (`request_id`) on `REFUND_REQUEST_PENDING` and
|
|
454
|
+
* `REFUND_REQUEST_REJECTED`. Not the backend request id, which is {@link requestId}.
|
|
455
|
+
*/
|
|
456
|
+
get refundRequestId(): string | undefined;
|
|
457
|
+
/** INVO's reason on `REFUND_REQUEST_REJECTED` (may be absent). */
|
|
458
|
+
get decisionReason(): string | undefined;
|
|
459
|
+
/** On `REFUND_WINDOW_CLOSED`: when the period was charged (ISO 8601). */
|
|
460
|
+
get periodChargedAt(): string | undefined;
|
|
461
|
+
/** On `REFUND_WINDOW_CLOSED`: the window length in days (30). */
|
|
462
|
+
get refundWindowDays(): number | undefined;
|
|
463
|
+
/** On `REFUND_WINDOW_CLOSED`: when the window closed (ISO 8601). */
|
|
464
|
+
get refundWindowClosedAt(): string | undefined;
|
|
416
465
|
/** True when the subscription is `canceled` or `expired` and the call cannot apply (`SUBSCRIPTION_TERMINAL`, 409). Start a new one. */
|
|
417
466
|
get isSubscriptionTerminal(): boolean;
|
|
418
467
|
/**
|
|
@@ -436,6 +485,27 @@ declare class InvoError extends Error {
|
|
|
436
485
|
get isFlowPaused(): boolean;
|
|
437
486
|
/** True when a create was refused because the game is not `live` (`GAME_NOT_LIVE`, 403). Make it live in the console. */
|
|
438
487
|
get isGameNotLive(): boolean;
|
|
488
|
+
/**
|
|
489
|
+
* True when `cards.createSetupSession` was refused because the member does not exist
|
|
490
|
+
* in this game yet (`PLAYER_NOT_FOUND`, 404). The card page never creates players;
|
|
491
|
+
* create the member first (any endpoint that creates players, for example a currency
|
|
492
|
+
* purchase), then mint the session again. The same code comes back from
|
|
493
|
+
* `cards.beginSetup` and from `mintPlayerToken` for the same reason.
|
|
494
|
+
*/
|
|
495
|
+
get isPlayerNotFound(): boolean;
|
|
496
|
+
/**
|
|
497
|
+
* True when `cards.createSetupSession` was refused because `playerEmail` was missing or
|
|
498
|
+
* is not an email address (`INVALID_PLAYER_EMAIL`, 400).
|
|
499
|
+
*/
|
|
500
|
+
get isInvalidPlayerEmail(): boolean;
|
|
501
|
+
/**
|
|
502
|
+
* True on an `INVALID_INPUT` refusal. Two sources, told apart by `status`:
|
|
503
|
+
* `status === 0` is this SDK refusing a value before the network (every client-side
|
|
504
|
+
* guard uses this code); `status === 400` is INVO refusing one, on
|
|
505
|
+
* `cards.createSetupSession` a `successUrl` / `cancelUrl` that uses a script scheme
|
|
506
|
+
* (`javascript:`, `data:`, `vbscript:`). http(s) and app deep-link schemes are fine.
|
|
507
|
+
*/
|
|
508
|
+
get isInvalidInput(): boolean;
|
|
439
509
|
/** Seconds to wait before retrying, when the backend throttled the call (429 `retry_after`). */
|
|
440
510
|
get retryAfter(): number | undefined;
|
|
441
511
|
/** `body` as a plain object, or `{}` if it's a string/number/null (non-JSON responses).
|
|
@@ -1515,7 +1585,11 @@ interface CompleteDeviceApprovalResult {
|
|
|
1515
1585
|
/** The last poll seen, for diagnostics. */
|
|
1516
1586
|
lastPoll?: DeviceApprovalPollResult;
|
|
1517
1587
|
}
|
|
1518
|
-
/**
|
|
1588
|
+
/**
|
|
1589
|
+
* Which rail pays for the subscription. Fixed at creation. `card`: the member's saved card is
|
|
1590
|
+
* charged the full price every period (card only since 2026-09-17; the coin wallet never pays
|
|
1591
|
+
* and never moves). `steam`: the member's wallet is spent first and Steam tops up the shortfall.
|
|
1592
|
+
*/
|
|
1519
1593
|
type SubscriptionFundingRail = "card" | "steam";
|
|
1520
1594
|
/** `month` (default) or `year`. */
|
|
1521
1595
|
type SubscriptionInterval = "month" | "year";
|
|
@@ -1604,6 +1678,11 @@ interface Subscription {
|
|
|
1604
1678
|
trialEnd: string | null;
|
|
1605
1679
|
canceledAt: string | null;
|
|
1606
1680
|
endedAt: string | null;
|
|
1681
|
+
/**
|
|
1682
|
+
* @deprecated Still returned, never removed. Since 2026-09-17 a card subscription is paid
|
|
1683
|
+
* only by card, so a `walletOnly: true` subscription can never be paid: every charge fails
|
|
1684
|
+
* with `failureCode: "wallet_only"` and it lapses through dunning to `expired`.
|
|
1685
|
+
*/
|
|
1607
1686
|
walletOnly: boolean;
|
|
1608
1687
|
/** A card is attached. Never the card's identifiers. */
|
|
1609
1688
|
hasPaymentMethod: boolean;
|
|
@@ -1619,6 +1698,13 @@ interface Subscription {
|
|
|
1619
1698
|
paidThrough: string | null;
|
|
1620
1699
|
/** Create/finalize responses only: what one period is worth in coins on this rail. */
|
|
1621
1700
|
amountCoinsEstimate?: string;
|
|
1701
|
+
/**
|
|
1702
|
+
* Only when the read asked for `includePlayer: true`: the member's email. INVO puts the
|
|
1703
|
+
* two player fields ON the subscription object, not in a separate block.
|
|
1704
|
+
*/
|
|
1705
|
+
playerEmail?: string | null;
|
|
1706
|
+
/** Only when the read asked for `includePlayer: true`: the member's name. */
|
|
1707
|
+
playerName?: string | null;
|
|
1622
1708
|
raw: Record<string, unknown>;
|
|
1623
1709
|
}
|
|
1624
1710
|
/** A saved card as INVO describes it. `id` is the only handle; never a processor id. */
|
|
@@ -1654,12 +1740,20 @@ type FirstChargeStatus = "paid" | "requires_action" | "skipped_trial" | "failed"
|
|
|
1654
1740
|
*/
|
|
1655
1741
|
interface FirstCharge {
|
|
1656
1742
|
status: FirstChargeStatus;
|
|
1657
|
-
/** On `paid`: the amount actually charged for period 1. */
|
|
1743
|
+
/** On `paid`: the amount actually charged for period 1 (on the card rail, always the full price). */
|
|
1658
1744
|
amountUsd: string | null;
|
|
1659
1745
|
/** The period that was just paid (`1` for the first period). `null` unless `status` is `paid`. */
|
|
1660
1746
|
paidPeriodSeq: number | null;
|
|
1661
1747
|
/** Same value as `subscription.paidThrough`, repeated so one object answers "what happened". */
|
|
1662
1748
|
paidThrough: string | null;
|
|
1749
|
+
/**
|
|
1750
|
+
* On `failed`: why. Card rail codes include `card_declined`, `no_payment_method` (no saved
|
|
1751
|
+
* card; a coin balance never pays a card subscription), `wallet_only` (a deprecated
|
|
1752
|
+
* `walletOnly` subscription, which can never be paid), `wallet_negative` (the member's coin
|
|
1753
|
+
* balance is below zero; nothing was charged), `card_expired`, `card_detached`,
|
|
1754
|
+
* `card_mismatch`, `no_customer_snapshot`, `processing_error`, `settlement_error`.
|
|
1755
|
+
* Treat unknown values as a generic failure.
|
|
1756
|
+
*/
|
|
1663
1757
|
failureCode: string | null;
|
|
1664
1758
|
nextRetryAt: string | null;
|
|
1665
1759
|
/** On `requires_action`: a single-use bearer link. Do not log it beside identifiers you publish. */
|
|
@@ -1686,7 +1780,7 @@ interface SubscriptionBaseInput {
|
|
|
1686
1780
|
itemId: string;
|
|
1687
1781
|
/** Echoed on events. Max 255. */
|
|
1688
1782
|
itemName?: string;
|
|
1689
|
-
/** `0.01` to `999999.99`, two decimals. Prices above `
|
|
1783
|
+
/** `0.01` to `999999.99`, two decimals. Prices above the per-charge ceiling of `25000.00` are accepted but never charged. */
|
|
1690
1784
|
amountUsd: string | number;
|
|
1691
1785
|
/** Default `month`. */
|
|
1692
1786
|
interval?: SubscriptionInterval;
|
|
@@ -1705,9 +1799,18 @@ interface CreateSubscriptionInput extends SubscriptionBaseInput {
|
|
|
1705
1799
|
trialDays?: number;
|
|
1706
1800
|
/** Explicit ISO 8601 trial end (future, within 365 days). Takes precedence over `trialDays`. */
|
|
1707
1801
|
trialEnd?: string;
|
|
1708
|
-
/**
|
|
1802
|
+
/**
|
|
1803
|
+
* @deprecated Do not send `true` on new integrations. Still accepted (default `false`), but
|
|
1804
|
+
* since 2026-09-17 a card subscription is paid only by card, so `true` means the subscription
|
|
1805
|
+
* can never be paid: every charge fails with `failureCode: "wallet_only"` and it lapses
|
|
1806
|
+
* through dunning to `expired`. Cannot be combined with `playerCardId`.
|
|
1807
|
+
*/
|
|
1709
1808
|
walletOnly?: boolean;
|
|
1710
|
-
/**
|
|
1809
|
+
/**
|
|
1810
|
+
* The `id` of a card from `cards.list`. Omitted: INVO picks the newest unexpired saved card.
|
|
1811
|
+
* With no saved card the subscription is still created, but its first charge fails with
|
|
1812
|
+
* `failureCode: "no_payment_method"` whatever the member's coin balance. Save a card first.
|
|
1813
|
+
*/
|
|
1711
1814
|
playerCardId?: number;
|
|
1712
1815
|
}
|
|
1713
1816
|
/** Result of `subscriptions.create` (201, or a 200 replay). */
|
|
@@ -1781,11 +1884,19 @@ interface SteamFinalizeSubscriptionResult extends SubscriptionResult {
|
|
|
1781
1884
|
sandboxAutoApproved: boolean;
|
|
1782
1885
|
}
|
|
1783
1886
|
interface GetSubscriptionOptions {
|
|
1784
|
-
/**
|
|
1887
|
+
/**
|
|
1888
|
+
* Adds `playerEmail` and `playerName` to the subscription object (and fills `player`
|
|
1889
|
+
* below from them). Default `false`.
|
|
1890
|
+
*/
|
|
1785
1891
|
includePlayer?: boolean;
|
|
1786
1892
|
}
|
|
1787
1893
|
interface GetSubscriptionResult {
|
|
1788
1894
|
subscription: Subscription;
|
|
1895
|
+
/**
|
|
1896
|
+
* `{ player_email, player_name }` when `includePlayer` was set. Derived from the two
|
|
1897
|
+
* fields INVO puts on the subscription object itself; prefer `subscription.playerEmail`
|
|
1898
|
+
* / `subscription.playerName`.
|
|
1899
|
+
*/
|
|
1789
1900
|
player?: Record<string, unknown>;
|
|
1790
1901
|
raw: Record<string, unknown>;
|
|
1791
1902
|
}
|
|
@@ -1857,7 +1968,11 @@ interface ChangeAmountResult {
|
|
|
1857
1968
|
subscription: Subscription | null;
|
|
1858
1969
|
raw: Record<string, unknown>;
|
|
1859
1970
|
}
|
|
1860
|
-
/**
|
|
1971
|
+
/**
|
|
1972
|
+
* Attach a card (optionally converting a wallet-only subscription), or make it wallet-only.
|
|
1973
|
+
* `{ walletOnly: true }` is deprecated: a wallet-only card subscription can never be paid
|
|
1974
|
+
* (every charge fails with `failure_code: "wallet_only"`).
|
|
1975
|
+
*/
|
|
1861
1976
|
type SetPaymentMethodInput = {
|
|
1862
1977
|
playerCardId: number;
|
|
1863
1978
|
walletOnly?: false;
|
|
@@ -1879,7 +1994,12 @@ interface RefundSubscriptionInput {
|
|
|
1879
1994
|
periodSeq?: number;
|
|
1880
1995
|
/** Defaults to the full remaining refundable amount. A partial refund is allowed. */
|
|
1881
1996
|
amountUsd?: string | number;
|
|
1882
|
-
/**
|
|
1997
|
+
/**
|
|
1998
|
+
* Max 500. Carried on the receipt, the audit trail and the events. RECOMMENDED now, and it
|
|
1999
|
+
* will become REQUIRED after a notice period. Without it the refund still runs (`reason` is
|
|
2000
|
+
* `null` on the receipt and the events) and the result carries
|
|
2001
|
+
* `warnings: [{ code: "REASON_RECOMMENDED" }]`.
|
|
2002
|
+
*/
|
|
1883
2003
|
reason?: string;
|
|
1884
2004
|
}
|
|
1885
2005
|
interface RefundRevenueShareAttribution {
|
|
@@ -1892,40 +2012,145 @@ interface RefundRevenueShareAttribution {
|
|
|
1892
2012
|
settledByInvo: boolean;
|
|
1893
2013
|
raw: Record<string, unknown>;
|
|
1894
2014
|
}
|
|
1895
|
-
/**
|
|
2015
|
+
/**
|
|
2016
|
+
* A non-fatal note on a refund result: `REASON_RECOMMENDED` (no `reason` was sent; it will
|
|
2017
|
+
* become required after a notice period) or `REASON_TRUNCATED` (the reason was cut to 500
|
|
2018
|
+
* characters). Treat unknown codes as informational.
|
|
2019
|
+
*/
|
|
2020
|
+
interface RefundWarning {
|
|
2021
|
+
code: string;
|
|
2022
|
+
message: string;
|
|
2023
|
+
}
|
|
2024
|
+
/** `self_serve` (your own call) or `approved_request` (INVO approved a refund request). */
|
|
2025
|
+
type RefundInitiation = "self_serve" | "approved_request";
|
|
2026
|
+
/** How `processingFeeUsd` was measured: `actual`, `estimated`, or `none` (no card refund). */
|
|
2027
|
+
type RefundProcessingFeeBasis = "actual" | "estimated" | "none";
|
|
2028
|
+
/**
|
|
2029
|
+
* The result of `subscriptions.refund`: the 200 receipt, or the 202 `pending_approval` body
|
|
2030
|
+
* (which carries every receipt key with the values of a refund that has not happened).
|
|
2031
|
+
*
|
|
2032
|
+
* Still ONE interface, so existing code that mocks, extends or implements it keeps
|
|
2033
|
+
* compiling. Branch with {@link isRefundPendingApproval} (or on `status`), which narrows to
|
|
2034
|
+
* {@link RefundPendingApproval}.
|
|
2035
|
+
*
|
|
2036
|
+
* The optional fields were added on 2026-09-17. They are `undefined` on a replayed receipt
|
|
2037
|
+
* stored before that date and on the reduced replay (`note` set). The `request*`, `dailyCapUsd`,
|
|
2038
|
+
* `executedTodayUsd` and `message` fields are present only on `pending_approval`.
|
|
2039
|
+
*/
|
|
1896
2040
|
interface RefundResult {
|
|
1897
|
-
/**
|
|
1898
|
-
|
|
2041
|
+
/**
|
|
2042
|
+
* `refunded` (HTTP 200) or `pending_approval` (HTTP 202; nothing moved). Passed through from
|
|
2043
|
+
* INVO unchanged; treat any other value as "not refunded".
|
|
2044
|
+
*/
|
|
2045
|
+
status: "refunded" | "pending_approval" | (string & {});
|
|
1899
2046
|
idempotentReplay: boolean;
|
|
1900
2047
|
refundKey: string | null;
|
|
1901
2048
|
clientRequestId: string | null;
|
|
1902
2049
|
subscriptionId: string;
|
|
1903
2050
|
periodSeq: number | null;
|
|
2051
|
+
/** `null` on `pending_approval`: nothing has moved. */
|
|
1904
2052
|
transactionId: string | null;
|
|
2053
|
+
/** `"0.00"` on `pending_approval` (where `totalRefundedAmountUsd` and `remainingRefundableUsd` keep the period's real values). */
|
|
1905
2054
|
refundedAmountUsd: string | null;
|
|
1906
2055
|
totalRefundedAmountUsd: string | null;
|
|
1907
2056
|
remainingRefundableUsd: string | null;
|
|
1908
2057
|
isFullRefund: boolean;
|
|
1909
|
-
/** `wallet` | `card` | `mixed`. */
|
|
2058
|
+
/** `wallet` | `card` | `mixed`. Every card period charged since 2026-09-17 is `card`. */
|
|
1910
2059
|
fundingShape: string | null;
|
|
1911
|
-
/**
|
|
2060
|
+
/**
|
|
2061
|
+
* Signed; can be negative on a period charged before 2026-09-17 whose card charge minted
|
|
2062
|
+
* coins. `"0.00"` on a card-only period, full or partial: the money goes to the card.
|
|
2063
|
+
*/
|
|
1912
2064
|
balanceDeltaCoins: string | null;
|
|
2065
|
+
/**
|
|
2066
|
+
* Cash returned to the card by this call. On a card-only period (every card period charged
|
|
2067
|
+
* since 2026-09-17) this equals `refundedAmountUsd`, partial refunds included. On an earlier
|
|
2068
|
+
* period a partial refund credits coins instead and this is `"0.00"`.
|
|
2069
|
+
*/
|
|
1913
2070
|
cardRefundedUsd: string | null;
|
|
1914
2071
|
processorRefundReference: string | null;
|
|
1915
2072
|
/** `true` when the card refund had already been issued by an earlier attempt and this call recorded it. */
|
|
1916
2073
|
processorRefundAdopted: boolean;
|
|
1917
2074
|
invoFeeRetained: boolean;
|
|
2075
|
+
/** Your revenue reversed for the refunded portion (revenue only; the processor fee is `processingFeeUsd`). */
|
|
1918
2076
|
partnerRevenueReversedUsd: string | null;
|
|
1919
|
-
/** `full` | `prorata
|
|
2077
|
+
/** `full` | `prorata` | `none` (`none` on `pending_approval`). */
|
|
1920
2078
|
partnerRevenueReversalMode: string | null;
|
|
2079
|
+
/** Exactly what you sent (cut to 500), or `null` when you sent none. */
|
|
1921
2080
|
reason: string | null;
|
|
1922
2081
|
refundedAt: string | null;
|
|
1923
2082
|
newBalance: string | null;
|
|
1924
2083
|
revenueShareAttribution: RefundRevenueShareAttribution | null;
|
|
1925
2084
|
/** On a reduced replay (receipt lost): "This refund was already processed." */
|
|
1926
2085
|
note?: string;
|
|
2086
|
+
/** Present only when there is something to say. Never on a stored-receipt replay. */
|
|
2087
|
+
warnings?: RefundWarning[];
|
|
2088
|
+
/** `true` when this refund completed the period and so cancelled the subscription. */
|
|
2089
|
+
subscriptionCanceled?: boolean;
|
|
2090
|
+
/** The subscription's status after this call (`canceled` after a full refund). */
|
|
2091
|
+
subscriptionStatus?: string | null;
|
|
2092
|
+
/**
|
|
2093
|
+
* The card processor fee you bear on a refund that returned money to a card, deducted from
|
|
2094
|
+
* your revenue as its own line. `"0.00"` on a coin refund.
|
|
2095
|
+
*/
|
|
2096
|
+
processingFeeUsd?: string | null;
|
|
2097
|
+
processingFeeBasis?: RefundProcessingFeeBasis | (string & {}) | null;
|
|
2098
|
+
/** Always `partner`. */
|
|
2099
|
+
processingFeeBorneBy?: string | null;
|
|
2100
|
+
processingFeeTransactionId?: string | null;
|
|
2101
|
+
/** `partnerRevenueReversedUsd` plus `processingFeeUsd`: everything this refund took from your revenue. */
|
|
2102
|
+
partnerTotalReversedUsd?: string | null;
|
|
2103
|
+
initiation?: RefundInitiation | (string & {}) | null;
|
|
2104
|
+
/** The refund request INVO approved, or `null` for your own self-serve refund. */
|
|
2105
|
+
refundRequestId?: string | null;
|
|
2106
|
+
/** `pending_approval` only: the refund request id (`SRR...`). */
|
|
2107
|
+
requestId?: string;
|
|
2108
|
+
/** `pending_approval` only: `pending` while INVO reviews it. */
|
|
2109
|
+
requestStatus?: string;
|
|
2110
|
+
/** `pending_approval` only: the amount you asked to refund. */
|
|
2111
|
+
requestedAmountUsd?: string | null;
|
|
2112
|
+
/** `pending_approval` only. */
|
|
2113
|
+
requestedAt?: string | null;
|
|
2114
|
+
/** `pending_approval` only: the game's daily self-serve refund limit when the request was filed. */
|
|
2115
|
+
dailyCapUsd?: string | null;
|
|
2116
|
+
/** `pending_approval` only: self-served refunds already executed for this game that UTC day. */
|
|
2117
|
+
executedTodayUsd?: string | null;
|
|
2118
|
+
/** `pending_approval` only. */
|
|
2119
|
+
message?: string | null;
|
|
1927
2120
|
raw: Record<string, unknown>;
|
|
1928
2121
|
}
|
|
2122
|
+
/** HTTP 200: the refund ran (`status: "refunded"`). A repeated `clientRequestId` returns the stored receipt with `idempotentReplay: true`. */
|
|
2123
|
+
interface RefundReceipt extends RefundResult {
|
|
2124
|
+
status: "refunded";
|
|
2125
|
+
}
|
|
2126
|
+
/**
|
|
2127
|
+
* HTTP 202: the refund would exceed the game's daily self-serve refund limit, so NOTHING moved
|
|
2128
|
+
* and it became a refund request for INVO to review. The outcome arrives as
|
|
2129
|
+
* `subscription.refund_approved` (sent together with `subscription.refunded`, in any
|
|
2130
|
+
* order; a retry of your key then returns the receipt) or `subscription.refund_rejected` (your key then throws
|
|
2131
|
+
* `err.isRefundRequestRejected`). The same `clientRequestId` returns the same body with
|
|
2132
|
+
* `idempotentReplay: true`.
|
|
2133
|
+
*/
|
|
2134
|
+
interface RefundPendingApproval extends RefundResult {
|
|
2135
|
+
status: "pending_approval";
|
|
2136
|
+
/** The refund request id (`SRR...`). Also on `refundRequestId`. */
|
|
2137
|
+
requestId: string;
|
|
2138
|
+
/** `pending` while INVO reviews it. */
|
|
2139
|
+
requestStatus: string;
|
|
2140
|
+
/** The amount you asked to refund. */
|
|
2141
|
+
requestedAmountUsd: string | null;
|
|
2142
|
+
requestedAt: string | null;
|
|
2143
|
+
/** The game's daily self-serve refund limit when the request was filed. */
|
|
2144
|
+
dailyCapUsd: string | null;
|
|
2145
|
+
/** Self-served refunds already executed for this game that UTC day. */
|
|
2146
|
+
executedTodayUsd: string | null;
|
|
2147
|
+
message: string | null;
|
|
2148
|
+
}
|
|
2149
|
+
/**
|
|
2150
|
+
* True when a refund became a refund request (HTTP 202, `status: "pending_approval"`): nothing
|
|
2151
|
+
* moved and INVO is reviewing it. Narrows the result to {@link RefundPendingApproval}.
|
|
2152
|
+
*/
|
|
2153
|
+
declare function isRefundPendingApproval(r: RefundResult): r is RefundPendingApproval;
|
|
1929
2154
|
interface CardSetupInput {
|
|
1930
2155
|
/** Must already exist in this game (this endpoint does not create players). */
|
|
1931
2156
|
playerEmail: string;
|
|
@@ -1969,6 +2194,39 @@ interface PlayerCardsResult {
|
|
|
1969
2194
|
cards: SavedCard[];
|
|
1970
2195
|
raw: Record<string, unknown>;
|
|
1971
2196
|
}
|
|
2197
|
+
/** Input for `cards.createSetupSession`. */
|
|
2198
|
+
interface CardSetupSessionInput {
|
|
2199
|
+
/** Must already exist in this game. The card page never creates players (`404 PLAYER_NOT_FOUND`). */
|
|
2200
|
+
playerEmail: string;
|
|
2201
|
+
/**
|
|
2202
|
+
* Where the page sends the member after the card is saved. Absent: the page shows
|
|
2203
|
+
* "Card saved, you can close this window". http(s) and app deep-link schemes only; a
|
|
2204
|
+
* script scheme is refused (`INVALID_INPUT`), by the SDK before the network and by INVO.
|
|
2205
|
+
*/
|
|
2206
|
+
successUrl?: string;
|
|
2207
|
+
/** Carried on the session; not used by the page today. Same scheme rule as `successUrl`. */
|
|
2208
|
+
cancelUrl?: string;
|
|
2209
|
+
/**
|
|
2210
|
+
* Stored on the session and NOT returned anywhere today (no read endpoint returns the
|
|
2211
|
+
* session, and the page redirects to `successUrl` verbatim). Put your own correlation id
|
|
2212
|
+
* in `successUrl` instead. Not validated by INVO.
|
|
2213
|
+
*/
|
|
2214
|
+
metadata?: Record<string, unknown>;
|
|
2215
|
+
}
|
|
2216
|
+
/**
|
|
2217
|
+
* Result of `cards.createSetupSession`: a short-lived link to the INVO-hosted card page.
|
|
2218
|
+
* Send the member to `cardSetupUrl` (top-level; do not frame it). The session lives
|
|
2219
|
+
* 10 minutes; once the card is saved the link is spent and reopening it returns the same
|
|
2220
|
+
* saved card. The saved card appears in `cards.list` immediately. No event fires.
|
|
2221
|
+
*/
|
|
2222
|
+
interface CardSetupSessionResult {
|
|
2223
|
+
sessionId: string;
|
|
2224
|
+
/** The INVO-hosted card page for this member. Never build this URL yourself. */
|
|
2225
|
+
cardSetupUrl: string;
|
|
2226
|
+
/** ISO 8601 with offset: 10 minutes after the mint. */
|
|
2227
|
+
expiresAt: string;
|
|
2228
|
+
raw: Record<string, unknown>;
|
|
2229
|
+
}
|
|
1972
2230
|
/** `card_declined` (default) | `insufficient_funds` | `error`. */
|
|
1973
2231
|
type SandboxFailureOutcome = "card_declined" | "insufficient_funds" | "error";
|
|
1974
2232
|
interface SandboxForceFailureOptions {
|
|
@@ -2031,4 +2289,4 @@ interface SandboxClockResult {
|
|
|
2031
2289
|
raw: Record<string, unknown>;
|
|
2032
2290
|
}
|
|
2033
2291
|
|
|
2034
|
-
export { type
|
|
2292
|
+
export { type SteamInitResult as $, type ApproveResult as A, type BalanceResult as B, type ConfirmReceiptResult as C, type DestinationsQuery as D, type EnrollmentBeginResult as E, type PlatformRefundResult as F, type CreateSubscriptionInput as G, Http as H, InvoError as I, type GetSubscriptionOptions as J, type GetSubscriptionResult as K, type LinkDeviceResult as L, type MountCheckoutOptions as M, type ListSubscriptionsOptions as N, type SubscriptionListResult as O, type PendingCollectResult as P, type CancelSubscriptionOptions as Q, type RecoveryBeginResult as R, type SubscriptionResult as S, type CancelResult as T, type ChangeAmountResult as U, type VerificationMethod as V, type SetPaymentMethodInput as W, type SetPaymentMethodResult as X, type RefundSubscriptionInput as Y, type RefundResult as Z, type SteamSubscriptionInitInput as _, type CheckoutMountHandle as a, type FirstCharge as a$, type SteamFinalizeSubscriptionResult as a0, type SandboxClockResult as a1, type SandboxFailureOutcome as a2, type SandboxForceFailureOptions as a3, type SandboxForceAuthChallengeOptions as a4, type ServerConfig as a5, type PlayerToken as a6, type InitiateSendInput as a7, type InitiateResult as a8, type InitiateTransferInput as a9, type ClaimCurrencyInput as aA, type TransactionStatusResult as aB, type GuardianApprovalStatusResult as aC, type ServerDestinationsQuery as aD, type PhoneShareContact as aE, type PhoneShareInitiateResult as aF, type PhoneShareApproveInput as aG, type PhoneShareApproveResult as aH, type PhoneShareStatusResult as aI, type BeginDeviceApprovalInput as aJ, type DeviceApprovalGrant as aK, type PollDeviceApprovalInput as aL, type DeviceApprovalPollResult as aM, type ConfirmDeviceEnrollmentInput as aN, type ConfirmDeviceEnrollmentResult as aO, type ApproveWithDeviceCodeInput as aP, type DeviceApprovalSettleResult as aQ, type CompleteDeviceApprovalInput as aR, type CompleteDeviceApprovalResult as aS, type CardSetupStatus as aT, type CurrencyBalance as aU, type DeviceApprovalChannel as aV, type DeviceApprovalEnrollment as aW, type DeviceApprovalFlow as aX, type DeviceApprovalPollStatus as aY, type DeviceEnrollmentDecision as aZ, type DeviceEnrollmentRespond as a_, type CreateCheckoutInput as aa, type CreateCheckoutResult as ab, type PurchaseInput as ac, type PurchaseResult as ad, type ConfirmPaymentResult as ae, type OrderDetailsResult as af, type SteamPacksQuery as ag, type SteamPacksResult as ah, type SteamInitPurchaseInput as ai, type SteamInitPurchaseResult as aj, type SteamFinalizeInput as ak, type SteamFinalizeResult as al, type PurchaseItemInput as am, type PurchaseItemResult as an, type ItemHistoryQuery as ao, type ItemHistoryResult as ap, type ItemOrderQuery as aq, type PlayerBalanceQuery as ar, type PlayerBalanceResult as as, type InboundPendingQuery as at, type InboundPendingResult as au, type LinkedIdentitiesQuery as av, type LinkedIdentitiesResult as aw, type SmsVerifyResult as ax, type ClaimTransferInput as ay, type ClaimResult as az, type ClientConfig as b, type FirstChargeStatus as b0, type FundingSource as b1, type InboundPendingItem as b2, type LinkedIdentityEmail as b3, type PlatformPurchaseStatus as b4, type RefundInitiation as b5, type RefundPendingApproval as b6, type RefundProcessingFeeBasis as b7, type RefundReceipt as b8, type RefundRevenueShareAttribution as b9, type RefundWarning as ba, type SandboxClockState as bb, type SavedCard as bc, type SteamPack as bd, type SteamUserSession as be, type Subscription as bf, type SubscriptionBaseInput as bg, type SubscriptionConsent as bh, type SubscriptionConsentInput as bi, type SubscriptionFundingRail as bj, type SubscriptionInterval as bk, type SubscriptionRevenueShare as bl, type SubscriptionRevenueShareInput as bm, type SubscriptionStatus as bn, isRefundPendingApproval as bo, type CallOptions 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 CardSetupSessionInput as p, type CardSetupSessionResult as q, type CardSetupInput as r, type CardSetupResult as s, type CardSetupConfirmInput as t, type CardSetupConfirmResult as u, type PlayerCardsResult as v, type PlatformPurchaseInput as w, type PlatformPurchaseResult as x, type PlatformOrderStatusResult as y, type PlatformRefundInput as z };
|