@invonetwork/web-sdk 3.20.0 → 3.22.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 +63 -0
- package/README.md +289 -34
- package/dist/{chunk-6IY4473A.js → chunk-BOD4WOWO.js} +257 -7
- package/dist/index.cjs +347 -6
- package/dist/index.d.cts +58 -5
- package/dist/index.d.ts +58 -5
- package/dist/index.js +119 -4
- package/dist/server.cjs +598 -41
- package/dist/server.d.cts +233 -28
- package/dist/server.d.ts +233 -28
- package/dist/server.js +380 -27
- package/dist/{types-BwgkJoM6.d.cts → types-C7vpPqsF.d.cts} +425 -6
- package/dist/{types-BwgkJoM6.d.ts → types-C7vpPqsF.d.ts} +425 -6
- package/package.json +1 -1
package/dist/server.d.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { I as InvoError, H as Http,
|
|
2
|
-
export {
|
|
1
|
+
import { I as InvoError, H as Http, $ as AuthHeader, a0 as CardSetupSessionInput, g as CallOptions, a1 as CardSetupSessionResult, a2 as CardSetupInput, a3 as CardSetupResult, a4 as CardSetupConfirmInput, a5 as CardSetupConfirmResult, a6 as PlayerCardsResult, a7 as PlatformPurchaseInput, a8 as PlatformPurchaseResult, a9 as PlatformOrderStatusResult, aa as PlatformPurchaseHistoryQuery, ab as PlatformPurchaseHistoryResult, ac as PlatformRefundInput, ad as PlatformRefundResult, ae as CreateSubscriptionInput, af as SubscriptionResult, ag as GetSubscriptionOptions, ah as GetSubscriptionResult, ai as ListSubscriptionsOptions, aj as SubscriptionListResult, ak as CancelSubscriptionOptions, al as CancelResult, am as ChangeAmountResult, an as SetPaymentMethodInput, ao as SetPaymentMethodResult, ap as RefundSubscriptionInput, aq as RefundResult, ar as SteamSubscriptionInitInput, as as SteamInitResult, at as SteamFinalizeSubscriptionResult, au as SandboxClockResult, av as SandboxFailureOutcome, aw as SandboxForceFailureOptions, ax as SandboxForceAuthChallengeOptions, ay as ServerConfig, az as MintPlayerTokenInput, aA as PlayerToken, aB as RegisterPlayerInput, aC as RegisterPlayerResult, aD as UpdatePlayerPhoneInput, aE as UpdatePlayerPhoneResult, aF as RequestPhoneChangeInput, aG as RequestPhoneChangeResult, aH as PhoneChangeRequest, aI as InitiateSendInput, aJ as InitiateResult, aK as InitiateTransferInput, aL as CreateCheckoutInput, aM as CreateCheckoutResult, aN as PurchaseInput, aO as PurchaseResult, aP as CurrencyPurchaseQuoteInput, aQ as CurrencyPurchaseQuote, aR as ConfirmPaymentResult, aS as OrderDetailsResult, aT as SteamPacksQuery, aU as SteamPacksResult, aV as SteamInitPurchaseInput, aW as SteamInitPurchaseResult, aX as SteamFinalizeInput, aY as SteamFinalizeResult, aZ as PurchaseItemInput, a_ as PurchaseItemResult, a$ as ItemHistoryQuery, b0 as ItemHistoryResult, b1 as ItemOrderQuery, b2 as PlayerActivityQuery, b3 as PlayerActivityResult, b4 as PlayerActivityEntry, b5 as PlayerBalanceQuery, b6 as PlayerBalanceResult, o as LoyaltyCardsResult, b7 as InboundPendingQuery, b8 as InboundPendingResult, b9 as LinkedIdentitiesQuery, ba as LinkedIdentitiesResult, bb as SmsVerifyResult, bc as ClaimTransferInput, bd as ClaimResult, be as ClaimCurrencyInput, bf as TransactionStatusResult, bg as GuardianApprovalStatusResult, bh as ServerDestinationsQuery, n as DestinationsResult, bi as PhoneShareContact, bj as PhoneShareInitiateResult, bk as PhoneShareApproveInput, bl as PhoneShareApproveResult, bm as PhoneShareStatusResult, bn as BeginDeviceApprovalInput, bo as DeviceApprovalGrant, bp as PollDeviceApprovalInput, bq as DeviceApprovalPollResult, br as ConfirmDeviceEnrollmentInput, bs as ConfirmDeviceEnrollmentResult, bt as ApproveWithDeviceCodeInput, bu as DeviceApprovalSettleResult, bv as CompleteDeviceApprovalInput, bw as CompleteDeviceApprovalResult } from './types-C7vpPqsF.js';
|
|
2
|
+
export { bx as CardSetupStatus, by as CheckoutWarning, w as ClaimDelivery, bz as CurrencyBalance, bA as CurrencyPurchaseQuoteBreakdown, x as DestinationGame, bB as DeviceApprovalChannel, bC as DeviceApprovalEnrollment, bD as DeviceApprovalFlow, bE as DeviceApprovalPollStatus, bF as DeviceEnrollmentDecision, bG as DeviceEnrollmentRespond, bH as ExpiryReason, bI as FeeTakenFrom, bJ as FirstCharge, bK as FirstChargeStatus, bL as FundingSource, bM as InboundPendingItem, y as InvoErrorInfo, z as InvoHooks, F as InvoRequestInfo, G as InvoResponseInfo, bN as LinkedIdentityEmail, J as LoyaltyCard, K as LoyaltyCardReward, N as LoyaltyCardStep, O as LoyaltyRewardState, Q as LoyaltyStepProgress, S as LoyaltyStepState, bO as MinPurchaseWarning, bP as PhoneChangeConfirmation, bQ as PhoneChangeRequestStatus, bR as PlatformPurchaseStatus, bS as PlayerActivityType, Z as Rail, bT as RefundInitiation, bU as RefundPendingApproval, bV as RefundProcessingFeeBasis, bW as RefundReceipt, bX as RefundRevenueShareAttribution, bY as RefundWarning, bZ as SandboxClockState, b_ as SavedCard, b$ as SteamPack, c0 as SteamUserSession, c1 as Subscription, c2 as SubscriptionBaseInput, c3 as SubscriptionConsent, c4 as SubscriptionConsentInput, c5 as SubscriptionFundingRail, c6 as SubscriptionInterval, c7 as SubscriptionRevenueShare, c8 as SubscriptionRevenueShareInput, c9 as SubscriptionStatus, ca as UnacknowledgedPurchaseOutcome, _ as VerificationMethod, cb as isRefundPendingApproval } from './types-C7vpPqsF.js';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* The package version, as sent in the server User-Agent. A test pins this to
|
|
6
6
|
* `package.json` so it cannot drift silently (it did: the UA read 3.0.0 through 3.7.0).
|
|
7
7
|
* Bump it with the changeset flow.
|
|
8
8
|
*/
|
|
9
|
-
declare const SDK_VERSION = "3.
|
|
9
|
+
declare const SDK_VERSION = "3.22.0";
|
|
10
10
|
|
|
11
11
|
interface VerifyWebhookOptions {
|
|
12
12
|
/** Max age of the signed timestamp, in seconds. Default 300 (5 min). */
|
|
@@ -67,7 +67,7 @@ interface PurchaseCompletedData {
|
|
|
67
67
|
receipt_url?: string;
|
|
68
68
|
/**
|
|
69
69
|
* Additive (2026-09 pricing). INVO's card fee charged to you for this purchase, USD decimal
|
|
70
|
-
* string:
|
|
70
|
+
* string: 3.5% + $0.30 on Open, 5.5% + $0.50 on Merchant of Record. The buyer paid the listed
|
|
71
71
|
* price (plus any tax) and received the listed coins; the fee nets against your earnings.
|
|
72
72
|
* Card purchases only; absent on purchases through a third-party storefront or payment rail,
|
|
73
73
|
* on an order charged before the 2026-09 pricing, and from backends that do not send it.
|
|
@@ -96,7 +96,9 @@ interface PurchaseEventData {
|
|
|
96
96
|
* or a subscription charge (`order_type` `"platform_commerce"` or `"subscription_renewal"`).
|
|
97
97
|
* `true` when INVO's chargeback guarantee covers this dispute: a fraud chargeback on a card
|
|
98
98
|
* sale, which INVO absorbs, so your share is not reversed or held and no dispute fee is passed
|
|
99
|
-
* to you.
|
|
99
|
+
* to you. The guarantee is a Merchant of Record term; Open-tier card payments made before
|
|
100
|
+
* November 8, 2026 keep it, later ones do not (`false`, passed through at cost). `false`
|
|
101
|
+
* for any other dispute, handled as before. Never sent on a coin purchase
|
|
100
102
|
* dispute (a lost coin chargeback takes back the player's coins, not your share, so there is
|
|
101
103
|
* nothing to cover), nor on an opened or won event. Do not read absence as either value.
|
|
102
104
|
*/
|
|
@@ -266,12 +268,85 @@ interface TransferEventData {
|
|
|
266
268
|
flow?: string;
|
|
267
269
|
amount?: string;
|
|
268
270
|
net_amount?: string;
|
|
269
|
-
/**
|
|
270
|
-
|
|
271
|
+
/**
|
|
272
|
+
* On `transfer.claim_pending` / `transfer.claim_expired`: `"outbound"` on the copy sent to
|
|
273
|
+
* the sending title (drives the sender's UI), `"inbound"` on the copy sent to the
|
|
274
|
+
* destination title (drives the receiving player's UI). A move inside one title sends that
|
|
275
|
+
* title BOTH copies, each with its own `event_id`: dedupe on `event_id`, not
|
|
276
|
+
* `transaction_id`, and act on `direction`.
|
|
277
|
+
*/
|
|
278
|
+
direction?: "inbound" | "outbound" | (string & {});
|
|
271
279
|
/** On inbound claim_pending: the recipient's phone (match to your player). */
|
|
272
280
|
to_phone?: string;
|
|
273
281
|
/** Recipient's opaque identity, present only when the phone maps to a single player. */
|
|
274
282
|
to_identity_id?: string | null;
|
|
283
|
+
/** On `transfer.claim_pending`: the order id of the send or transfer. */
|
|
284
|
+
order_id?: string | null;
|
|
285
|
+
/** On `transfer.claim_pending`: what the recipient receives after fees. */
|
|
286
|
+
net_transfer_amount?: string;
|
|
287
|
+
/** On `transfer.claim_pending`: when the recipient's chance to collect lapses (ISO 8601). */
|
|
288
|
+
claim_code_expires_at?: string | null;
|
|
289
|
+
from_game_id?: string | number;
|
|
290
|
+
to_game_id?: string | number;
|
|
291
|
+
from_player_id?: string | number;
|
|
292
|
+
/** On `transfer.claim_expired` and an expiry `transfer.refunded`: when it expired (ISO 8601). */
|
|
293
|
+
expired_at?: string;
|
|
294
|
+
/**
|
|
295
|
+
* On `transfer.refunded` after an expiry: `"claim_expired"` or `"pin_expired"` (the latter
|
|
296
|
+
* also covers a lapsed in-app approval). Read `expiry_reason` for the precise cause.
|
|
297
|
+
*/
|
|
298
|
+
reason?: string;
|
|
299
|
+
/**
|
|
300
|
+
* Additive. On `transfer.claim_expired` and an expiry `transfer.refunded`: why it lapsed,
|
|
301
|
+
* `"approval_expired"`, `"pin_expired"` or `"claim_expired"`. Absent on older deliveries.
|
|
302
|
+
*/
|
|
303
|
+
expiry_reason?: "approval_expired" | "pin_expired" | "claim_expired" | (string & {});
|
|
304
|
+
/** On `transfer.refunded`: the amount returned to the sender. */
|
|
305
|
+
refunded_amount?: string;
|
|
306
|
+
[key: string]: unknown;
|
|
307
|
+
}
|
|
308
|
+
/**
|
|
309
|
+
* `payout.status_changed`: a payout of your balance to your bank moved to a new status. The
|
|
310
|
+
* money fields are decimal strings (USD) or `null`. The payout fee fields are `null` on a
|
|
311
|
+
* payout recorded before the fee existed.
|
|
312
|
+
*/
|
|
313
|
+
interface PayoutStatusChangedData {
|
|
314
|
+
payout_id: string | number;
|
|
315
|
+
status: string;
|
|
316
|
+
previous_status: string | null;
|
|
317
|
+
requested_amount_usd: string | null;
|
|
318
|
+
/** The payout fee rate applied, percent (for example `"1"`). */
|
|
319
|
+
offboarding_fee_pct?: string | null;
|
|
320
|
+
/** The payout fee deducted from this payout. */
|
|
321
|
+
offboarding_fee_usd?: string | null;
|
|
322
|
+
/** What reaches your bank: the requested amount less the payout fee. */
|
|
323
|
+
net_payout_usd?: string | null;
|
|
324
|
+
/** The cap on the payout fee per payout (for example `"500.00"`); `null` means no cap. */
|
|
325
|
+
offboarding_fee_cap_usd?: string | null;
|
|
326
|
+
[key: string]: unknown;
|
|
327
|
+
}
|
|
328
|
+
/**
|
|
329
|
+
* `player.phone_changed`: a player's phone changed (confirmed by the player, or changed by
|
|
330
|
+
* INVO support). Sent to every game the player is in. `new_phone` is present only for the
|
|
331
|
+
* game that requested the change (`new_phone_included: true`); every other game, and every
|
|
332
|
+
* game on a support change, gets `new_phone_masked` only. Store the new `identity_id` and
|
|
333
|
+
* re-mint the player's token. Never push the number you have stored back to INVO; if you
|
|
334
|
+
* need the full new number and did not receive it, ask the player.
|
|
335
|
+
*/
|
|
336
|
+
interface PlayerPhoneChangedData {
|
|
337
|
+
player_email: string;
|
|
338
|
+
previous_phone_masked: string | null;
|
|
339
|
+
new_phone_masked: string | null;
|
|
340
|
+
/** `true` only for the game that requested the change; then `new_phone` is present. */
|
|
341
|
+
new_phone_included: boolean;
|
|
342
|
+
/** The full new number, E.164. Present only when `new_phone_included` is `true`. */
|
|
343
|
+
new_phone?: string;
|
|
344
|
+
changed_at: string;
|
|
345
|
+
/** `"player"` (confirmed by the player) or `"support"` (changed by INVO support). */
|
|
346
|
+
source: "player" | "support" | (string & {});
|
|
347
|
+
/** The player's new identity id. */
|
|
348
|
+
identity_id: string;
|
|
349
|
+
previous_identity_id: string;
|
|
275
350
|
[key: string]: unknown;
|
|
276
351
|
}
|
|
277
352
|
/**
|
|
@@ -334,7 +409,7 @@ interface SubscriptionRenewalFunding {
|
|
|
334
409
|
[key: string]: unknown;
|
|
335
410
|
}
|
|
336
411
|
/**
|
|
337
|
-
* The fee split for one renewal. On the card rail INVO's fee (`invo_fee_usd`) is
|
|
412
|
+
* The fee split for one renewal. On the card rail INVO's fee (`invo_fee_usd`) is 3.5% + $0.30
|
|
338
413
|
* on Open (5.5% + $0.50 on Merchant of Record) of the listed price (before tax). The 1.5%
|
|
339
414
|
* international card fee on a card issued outside the US is NOT inside `invo_fee_usd`: it is
|
|
340
415
|
* reported separately as `international_card_fee_usd` (also `pass_through_fees_usd`) and charged
|
|
@@ -712,7 +787,10 @@ type InvoWebhookEvent = (WebhookBase & {
|
|
|
712
787
|
data: SubscriptionRefundRejectedData;
|
|
713
788
|
}) | (WebhookBase & {
|
|
714
789
|
event_type: "payout.status_changed";
|
|
715
|
-
data:
|
|
790
|
+
data: PayoutStatusChangedData;
|
|
791
|
+
}) | (WebhookBase & {
|
|
792
|
+
event_type: "player.phone_changed";
|
|
793
|
+
data: PlayerPhoneChangedData;
|
|
716
794
|
}) | (WebhookBase & {
|
|
717
795
|
event_type: "webhook.test";
|
|
718
796
|
data: Record<string, unknown>;
|
|
@@ -821,6 +899,33 @@ declare class PlatformCommerceServer {
|
|
|
821
899
|
/** Poll an order's status: `completed` (balance immediately; card after the webhook),
|
|
822
900
|
* `pending_payment` (card awaiting confirmation), or `refunded`. */
|
|
823
901
|
getStatus(orderId: string | number, opts?: CallOptions): Promise<PlatformOrderStatusResult>;
|
|
902
|
+
/**
|
|
903
|
+
* One player's Platform Commerce purchases in your app, newest first, one page at a time
|
|
904
|
+
* (`GET /api/platform-commerce/purchase-history`). Each entry carries exactly the fields
|
|
905
|
+
* `getStatus` returns for that order (including `receiptNumber` / `receiptUrl` on a
|
|
906
|
+
* Merchant of Record card sale once issued). Pass `nextCursor` back as `cursor` for the
|
|
907
|
+
* next page; it is `null` on the last one. `iteratePurchaseHistory` walks every page.
|
|
908
|
+
*
|
|
909
|
+
* Refusals (`InvoError`; this route reports its code in `error_code`, surfaced as
|
|
910
|
+
* `err.code`): a blank `playerEmail` or a bad `limit` / `cursor` throws `INVALID_INPUT`
|
|
911
|
+
* before the network; `400 INVALID_INPUT`, `400 INVALID_CURSOR` (a cursor from another
|
|
912
|
+
* player), `404 PLAYER_NOT_FOUND` (`err.isPlayerNotFound`), `403` for a non-platform
|
|
913
|
+
* tenant (`err.isNotPlatformTenant`), `429` (back off; `err.retryAfter`). A GET, so
|
|
914
|
+
* transient failures are retried automatically.
|
|
915
|
+
*/
|
|
916
|
+
getPurchaseHistory(query: PlatformPurchaseHistoryQuery, opts?: CallOptions): Promise<PlatformPurchaseHistoryResult>;
|
|
917
|
+
/**
|
|
918
|
+
* Async iterator over ALL of a player's Platform Commerce purchases, newest first: pages
|
|
919
|
+
* through `getPurchaseHistory` by `nextCursor`, yielding one order at a time.
|
|
920
|
+
*
|
|
921
|
+
* ```ts
|
|
922
|
+
* for await (const order of invo.platformCommerce.iteratePurchaseHistory({ playerEmail })) { … }
|
|
923
|
+
* ```
|
|
924
|
+
*/
|
|
925
|
+
iteratePurchaseHistory(query: {
|
|
926
|
+
playerEmail: string;
|
|
927
|
+
pageSize?: number;
|
|
928
|
+
}, opts?: CallOptions): AsyncGenerator<PlatformOrderStatusResult, void, unknown>;
|
|
824
929
|
/**
|
|
825
930
|
* Refund a completed purchase. Provide EXACTLY ONE of `orderId` or `clientRequestId`.
|
|
826
931
|
* INVO retains its fee — the customer is made whole (balance re-credit or card refund)
|
|
@@ -1216,21 +1321,83 @@ declare class InvoServer {
|
|
|
1216
1321
|
/**
|
|
1217
1322
|
* Mint a short-lived, game-scoped player token to hand to the browser InvoClient.
|
|
1218
1323
|
*
|
|
1219
|
-
*
|
|
1220
|
-
*
|
|
1221
|
-
*
|
|
1222
|
-
*
|
|
1223
|
-
*
|
|
1324
|
+
* For a player who already exists in your game, this is a session mint: INVO looks the
|
|
1325
|
+
* player up by `playerEmail` and returns a token for their identity. `playerPhone` and
|
|
1326
|
+
* `playerName` do not change an existing player.
|
|
1327
|
+
*
|
|
1328
|
+
* For a player who is NOT in your game yet: without `playerPhone` INVO answers 404
|
|
1329
|
+
* (`err.isPlayerNotFound`); with `playerPhone` INVO creates the player and the result
|
|
1330
|
+
* carries `created: true`, so a first-time receiver can collect without buying first.
|
|
1331
|
+
* Use `registerPlayer` when you want creation to be explicit.
|
|
1224
1332
|
*
|
|
1225
|
-
* `
|
|
1226
|
-
*
|
|
1227
|
-
*
|
|
1228
|
-
*
|
|
1333
|
+
* `phoneMismatch: true` means the existing player has a different phone than the one
|
|
1334
|
+
* you passed; the token is still for that player and their phone is unchanged
|
|
1335
|
+
* (`updatePlayerPhone` changes it). A phone already held by another email is a 409
|
|
1336
|
+
* (`err.isPhoneShareRefused`).
|
|
1229
1337
|
*/
|
|
1230
|
-
mintPlayerToken(input:
|
|
1231
|
-
|
|
1232
|
-
|
|
1233
|
-
|
|
1338
|
+
mintPlayerToken(input: MintPlayerTokenInput, opts?: CallOptions): Promise<PlayerToken>;
|
|
1339
|
+
/**
|
|
1340
|
+
* Create a player in your game without moving money (`POST /api/sdk/players`), so a
|
|
1341
|
+
* first-time receiver can collect in-game. Sends no message to the player.
|
|
1342
|
+
*
|
|
1343
|
+
* Returns `status: "created"` (new) or `"exists"` (already in your game with that
|
|
1344
|
+
* phone), with a player token when INVO can issue one. Refusals: 409
|
|
1345
|
+
* `err.isPhoneMismatch` (already in your game with a different phone; use
|
|
1346
|
+
* `updatePlayerPhone`), 409 `err.isPhoneShareRefused` (the phone belongs to another
|
|
1347
|
+
* email), 400 `INVALID_INPUT` / `INVALID_PHONE`, 429 (`err.retryAfter`).
|
|
1348
|
+
*/
|
|
1349
|
+
registerPlayer(input: RegisterPlayerInput, opts?: CallOptions): Promise<RegisterPlayerResult>;
|
|
1350
|
+
/**
|
|
1351
|
+
* Set a player's phone from your server (`POST /api/sdk/players/phone`). A phone change
|
|
1352
|
+
* can give the player a new INVO identity: `identityRekeyed: true`, and the result
|
|
1353
|
+
* carries a fresh `playerToken` for it (tokens minted before the change are then out
|
|
1354
|
+
* of date).
|
|
1355
|
+
*
|
|
1356
|
+
* Refusals: 409 `err.isPhoneChangeRequiresVerification` (the player has secured this
|
|
1357
|
+
* account, so the change needs the player's own confirmation: call `requestPhoneChange`;
|
|
1358
|
+
* `err.changeRequestEndpoint` names the route), 409 `err.isPhoneShareRefused` (the
|
|
1359
|
+
* number belongs to another email), 409 `err.isPendingTransfersToOldPhone` /
|
|
1360
|
+
* `err.isPendingTransfersToNewPhone` (transfers to the current or the new number are still
|
|
1361
|
+
* waiting to be collected), 404 `err.isPlayerNotFound`, 400 `INVALID_INPUT` / `INVALID_PHONE`, 429
|
|
1362
|
+
* (`err.retryAfter`), 503 (could not be checked right now; try again shortly).
|
|
1363
|
+
*
|
|
1364
|
+
* Never auto-retried: a retry after a change that landed would answer `"unchanged"` and
|
|
1365
|
+
* hide `identityRekeyed`.
|
|
1366
|
+
*/
|
|
1367
|
+
updatePlayerPhone(input: UpdatePlayerPhoneInput, opts?: CallOptions): Promise<UpdatePlayerPhoneResult>;
|
|
1368
|
+
/**
|
|
1369
|
+
* Ask the player to confirm a new phone number
|
|
1370
|
+
* (`POST /api/sdk/players/phone/change-requests`, HTTP 202). Use it when `updatePlayerPhone`
|
|
1371
|
+
* answers 409 `err.isPhoneChangeRequiresVerification`.
|
|
1372
|
+
*
|
|
1373
|
+
* Nothing about the player changes here. INVO emails the player a code and a link to a
|
|
1374
|
+
* page on INVO's site, and the player confirms there (plus their passkey on that page, or
|
|
1375
|
+
* an approval on their enrolled device, when they have one: see `confirmation`). Your game
|
|
1376
|
+
* never collects the code and never receives the link: do not ask the player for it.
|
|
1377
|
+
* Follow up with `getPhoneChange`, or wait for the `player.phone_changed` webhook.
|
|
1378
|
+
*
|
|
1379
|
+
* Refusals carry `err.code`, for example 409 `PHONE_SAME`, `PHONE_IN_USE_BY_ANOTHER_PLAYER`,
|
|
1380
|
+
* `PENDING_TRANSFERS_TO_NEW_PHONE` (`err.isPendingTransfersToNewPhone`),
|
|
1381
|
+
* `PENDING_TRANSFERS_TO_OLD_PHONE` (`err.isPendingTransfersToOldPhone`),
|
|
1382
|
+
* `CHANGE_REQUEST_IN_PROGRESS` (`err.isChangeRequestInProgress`), `PHONE_CHANGE_LOCKED`
|
|
1383
|
+
* (`err.isPhoneChangeLocked`), `PHONE_CHANGE_RECOVERY_COOLDOWN`
|
|
1384
|
+
* (`err.isPhoneChangeRecoveryCooldown`), `STEP_UP_UNAVAILABLE`, `WALLET_SECURED`,
|
|
1385
|
+
* `PHONE_NOT_SET`;
|
|
1386
|
+
* 429 `err.isTooManyChangeRequests`; 404 `err.isPlayerNotFound`; 503
|
|
1387
|
+
* `err.isPhoneChangeUnavailable`.
|
|
1388
|
+
*
|
|
1389
|
+
* Never auto-retried: a new request replaces your earlier pending one and sends the player
|
|
1390
|
+
* another email.
|
|
1391
|
+
*/
|
|
1392
|
+
requestPhoneChange(input: RequestPhoneChangeInput, opts?: CallOptions): Promise<RequestPhoneChangeResult>;
|
|
1393
|
+
/**
|
|
1394
|
+
* Read a change request your game created
|
|
1395
|
+
* (`GET /api/sdk/players/phone/change-requests/{changeRequestId}`). `status` is `pending`,
|
|
1396
|
+
* `confirmed`, `expired`, `cancelled`, `refused` or `denied`. A request another game
|
|
1397
|
+
* created, or an unknown id, is 404 `err.isChangeRequestNotFound`. Poll sparingly, or wait
|
|
1398
|
+
* for the `player.phone_changed` webhook.
|
|
1399
|
+
*/
|
|
1400
|
+
getPhoneChange(changeRequestId: string, opts?: CallOptions): Promise<PhoneChangeRequest>;
|
|
1234
1401
|
/**
|
|
1235
1402
|
* Initiate a cross-game currency SEND. Inspect result.verificationMethod.
|
|
1236
1403
|
*
|
|
@@ -1256,7 +1423,7 @@ declare class InvoServer {
|
|
|
1256
1423
|
* - rail "game": returns status "pending_payment" + paymentUrl (redirect the browser).
|
|
1257
1424
|
* - rail "steam": NOT a browser flow — the backend returns WRONG_RAIL_ENDPOINT.
|
|
1258
1425
|
*
|
|
1259
|
-
* INVO's card fee (
|
|
1426
|
+
* INVO's card fee (3.5% + $0.30 on Open, 5.5% + $0.50 on Merchant of Record, plus 1.5% of
|
|
1260
1427
|
* the listed price (before tax) on a card issued outside the US) is charged to you, the partner. The player
|
|
1261
1428
|
* pays the listed price (plus any tax) and receives the listed coins. Card purchases only;
|
|
1262
1429
|
* purchases through a third-party storefront or payment rail are unaffected. Two shapes,
|
|
@@ -1286,9 +1453,9 @@ declare class InvoServer {
|
|
|
1286
1453
|
*
|
|
1287
1454
|
* The player pays the listed price plus any tax (when you pass `country`) and receives the
|
|
1288
1455
|
* listed coins: `totalUsd` carries no card fee, and `processingFeeUsd` is `"0.00"`. INVO's
|
|
1289
|
-
* card fee (
|
|
1456
|
+
* card fee (3.5% + $0.30 on Open, 5.5% + $0.50 on Merchant of Record) is charged to you;
|
|
1290
1457
|
* `partnerFeeUsd` carries it when INVO sends it. $10.00 quotes a $10.00 total, 100.00 coins
|
|
1291
|
-
* at the default 10 per USD, and a $0.
|
|
1458
|
+
* at the default 10 per USD, and a $0.65 partner fee on Open. Show the player `totalUsd`,
|
|
1292
1459
|
* then send the same figure back as `acknowledgedTotalUsd` on {@link purchaseCurrency}; the
|
|
1293
1460
|
* card is never charged more than that. `ifUnacknowledged` shows the purchase without the
|
|
1294
1461
|
* acknowledgement (the card charged exactly `usdAmount`), or `null` when INVO sends none.
|
|
@@ -1399,6 +1566,42 @@ declare class InvoServer {
|
|
|
1399
1566
|
playerEmail: string;
|
|
1400
1567
|
pageSize?: number;
|
|
1401
1568
|
}, opts?: CallOptions): AsyncGenerator<Record<string, unknown>, void, unknown>;
|
|
1569
|
+
/**
|
|
1570
|
+
* One merged, newest-first list of a player's money activity in your game, one page at a
|
|
1571
|
+
* time (`GET /api/sdk/players/activity`): currency purchases, item purchases, Platform
|
|
1572
|
+
* Commerce purchases, sends and transfers, in both directions. Only rows where your game
|
|
1573
|
+
* is a party through this player are listed; the other side of a cross-game send or
|
|
1574
|
+
* transfer is named by game only (`counterpartyGame`).
|
|
1575
|
+
*
|
|
1576
|
+
* An inbound (`direction: "in"`) send or transfer is listed as soon as it names this
|
|
1577
|
+
* player, in ANY status (awaiting collection, completed, expired, refunded): read `status`
|
|
1578
|
+
* and `statusDetail` before treating it as credited. `direction` is `"in"` / `"out"` /
|
|
1579
|
+
* `"self"`, not the `"incoming"` / `"outgoing"` of the per-type history reads.
|
|
1580
|
+
*
|
|
1581
|
+
* Pass `nextCursor` back as `cursor` (with the same `types`) for the next page; it is
|
|
1582
|
+
* `null` on the last one. `iteratePlayerActivity` walks every page.
|
|
1583
|
+
*
|
|
1584
|
+
* Refusals (`InvoError`): a blank `playerEmail` or a bad `limit` / `cursor` / `types`
|
|
1585
|
+
* throws `INVALID_INPUT` before the network; `400 INVALID_INPUT` (for example an unknown
|
|
1586
|
+
* kind in `types`), `400 INVALID_CURSOR` (a cursor from another player or other `types`),
|
|
1587
|
+
* `401 INVALID_GAME_SECRET`, `404 PLAYER_NOT_FOUND` (`err.isPlayerNotFound`),
|
|
1588
|
+
* `500 PLAYER_ACTIVITY_FAILED` (retry later), `429` (back off; `err.retryAfter`). A GET, so
|
|
1589
|
+
* transient failures are retried automatically.
|
|
1590
|
+
*/
|
|
1591
|
+
getPlayerActivity(query: PlayerActivityQuery, opts?: CallOptions): Promise<PlayerActivityResult>;
|
|
1592
|
+
/**
|
|
1593
|
+
* Async iterator over a player's ENTIRE activity, newest first: pages through
|
|
1594
|
+
* `getPlayerActivity` by `nextCursor`, yielding one row at a time.
|
|
1595
|
+
*
|
|
1596
|
+
* ```ts
|
|
1597
|
+
* for await (const row of invo.iteratePlayerActivity({ playerEmail, types: ["send", "transfer"] })) { … }
|
|
1598
|
+
* ```
|
|
1599
|
+
*/
|
|
1600
|
+
iteratePlayerActivity(query: {
|
|
1601
|
+
playerEmail: string;
|
|
1602
|
+
types?: PlayerActivityQuery["types"];
|
|
1603
|
+
pageSize?: number;
|
|
1604
|
+
}, opts?: CallOptions): AsyncGenerator<PlayerActivityEntry, void, unknown>;
|
|
1402
1605
|
/**
|
|
1403
1606
|
* Read a player's currency balances by email (server-side, game-secret).
|
|
1404
1607
|
*
|
|
@@ -1591,8 +1794,10 @@ declare class InvoServer {
|
|
|
1591
1794
|
*
|
|
1592
1795
|
* Throws `InvoError`: `err.isDeviceApprovalNotApproved` (400 — wrong/foreign code,
|
|
1593
1796
|
* wrong flow, or the poll never said approved), `err.isPasskeyRecoveryCooldown` (403,
|
|
1594
|
-
* money-out after a passkey recovery — `err.retryAfterAt`),
|
|
1595
|
-
* (
|
|
1797
|
+
* money-out after a passkey recovery — `err.retryAfterAt`), `err.isPlayerTokenStale`
|
|
1798
|
+
* (403, the player token predates the sender's phone being added: re-mint, or use the
|
|
1799
|
+
* initiate's `playerToken`, and retry once), guardian terminal states (410). Never
|
|
1800
|
+
* auto-retried: the device_code is a single-use factor.
|
|
1596
1801
|
*
|
|
1597
1802
|
* **A FAILURE HERE IS AMBIGUOUS ABOUT THE MONEY.** The backend commits the transfer and
|
|
1598
1803
|
* *then* builds its 200 by reading the transaction back, so a fault raised after that
|
|
@@ -1635,4 +1840,4 @@ declare class InvoServer {
|
|
|
1635
1840
|
private toInitiateResult;
|
|
1636
1841
|
}
|
|
1637
1842
|
|
|
1638
|
-
export { ApproveWithDeviceCodeInput, BeginDeviceApprovalInput, CallOptions, CancelResult, CancelSubscriptionOptions, CardSetupConfirmInput, CardSetupConfirmResult, CardSetupInput, CardSetupResult, CardSetupSessionInput, CardSetupSessionResult, CardsServer, ChangeAmountResult, ClaimCurrencyInput, ClaimResult, ClaimTransferInput, CompleteDeviceApprovalInput, CompleteDeviceApprovalResult, ConfirmDeviceEnrollmentInput, ConfirmDeviceEnrollmentResult, ConfirmPaymentResult, CreateCheckoutInput, CreateCheckoutResult, CreateSubscriptionInput, CurrencyPurchaseQuote, CurrencyPurchaseQuoteInput, DestinationsResult, DeviceApprovalGrant, DeviceApprovalPollResult, DeviceApprovalSettleResult, GetSubscriptionOptions, GetSubscriptionResult, GuardianApprovalStatusResult, InboundPendingQuery, InboundPendingResult, InitiateResult, InitiateSendInput, InitiateTransferInput, InvoError, InvoServer, type InvoWebhookEvent, ItemHistoryQuery, ItemHistoryResult, ItemOrderQuery, type ItemPurchasedData, LinkedIdentitiesQuery, LinkedIdentitiesResult, ListSubscriptionsOptions, LoyaltyCardsResult, OrderDetailsResult, PhoneShareApproveInput, PhoneShareApproveResult, PhoneShareContact, PhoneShareInitiateResult, PhoneShareStatusResult, type PlatformCommercePurchasedData, type PlatformCommerceRefundedData, PlatformCommerceServer, PlatformOrderStatusResult, PlatformPurchaseInput, PlatformPurchaseResult, PlatformRefundInput, PlatformRefundResult, PlayerBalanceQuery, PlayerBalanceResult, PlayerCardsResult, PlayerToken, PollDeviceApprovalInput, type PurchaseCompletedData, type PurchaseEventData, PurchaseInput, PurchaseItemInput, PurchaseItemResult, PurchaseResult, RefundResult, RefundSubscriptionInput, SDK_VERSION, SandboxClockResult, SandboxFailureOutcome, SandboxForceAuthChallengeOptions, SandboxForceFailureOptions, SandboxServer, SandboxSubscriptionsServer, ServerConfig, ServerDestinationsQuery, SetPaymentMethodInput, SetPaymentMethodResult, SmsVerifyResult, SteamFinalizeInput, SteamFinalizeResult, SteamFinalizeSubscriptionResult, SteamInitPurchaseInput, SteamInitPurchaseResult, SteamInitResult, SteamPacksQuery, SteamPacksResult, SteamSubscriptionInitInput, type SubscriptionAuthenticationRequiredData, type SubscriptionCanceledData, type SubscriptionEventCommon, type SubscriptionExpiredData, SubscriptionListResult, type SubscriptionPastDueData, type SubscriptionPaymentFailedData, type SubscriptionRefundApprovedData, type SubscriptionRefundDetail, type SubscriptionRefundRejectedData, type SubscriptionRefundRequestData, type SubscriptionRefundedData, type SubscriptionRenewalFunding, type SubscriptionRenewalSplit, type SubscriptionRenewedData, SubscriptionResult, type SubscriptionRevenueShareAttribution, type SubscriptionTrialEventFields, SubscriptionsServer, TransactionStatusResult, type TransferEventData, type VerifyWebhookOptions, type WebhookHandlerOptions, createWebhookHandler, verifyWebhook, verifyWebhookAsync };
|
|
1843
|
+
export { ApproveWithDeviceCodeInput, BeginDeviceApprovalInput, CallOptions, CancelResult, CancelSubscriptionOptions, CardSetupConfirmInput, CardSetupConfirmResult, CardSetupInput, CardSetupResult, CardSetupSessionInput, CardSetupSessionResult, CardsServer, ChangeAmountResult, ClaimCurrencyInput, ClaimResult, ClaimTransferInput, CompleteDeviceApprovalInput, CompleteDeviceApprovalResult, ConfirmDeviceEnrollmentInput, ConfirmDeviceEnrollmentResult, ConfirmPaymentResult, CreateCheckoutInput, CreateCheckoutResult, CreateSubscriptionInput, CurrencyPurchaseQuote, CurrencyPurchaseQuoteInput, DestinationsResult, DeviceApprovalGrant, DeviceApprovalPollResult, DeviceApprovalSettleResult, GetSubscriptionOptions, GetSubscriptionResult, GuardianApprovalStatusResult, InboundPendingQuery, InboundPendingResult, InitiateResult, InitiateSendInput, InitiateTransferInput, InvoError, InvoServer, type InvoWebhookEvent, ItemHistoryQuery, ItemHistoryResult, ItemOrderQuery, type ItemPurchasedData, LinkedIdentitiesQuery, LinkedIdentitiesResult, ListSubscriptionsOptions, LoyaltyCardsResult, MintPlayerTokenInput, OrderDetailsResult, type PayoutStatusChangedData, PhoneChangeRequest, PhoneShareApproveInput, PhoneShareApproveResult, PhoneShareContact, PhoneShareInitiateResult, PhoneShareStatusResult, type PlatformCommercePurchasedData, type PlatformCommerceRefundedData, PlatformCommerceServer, PlatformOrderStatusResult, PlatformPurchaseHistoryQuery, PlatformPurchaseHistoryResult, PlatformPurchaseInput, PlatformPurchaseResult, PlatformRefundInput, PlatformRefundResult, PlayerActivityEntry, PlayerActivityQuery, PlayerActivityResult, PlayerBalanceQuery, PlayerBalanceResult, PlayerCardsResult, type PlayerPhoneChangedData, PlayerToken, PollDeviceApprovalInput, type PurchaseCompletedData, type PurchaseEventData, PurchaseInput, PurchaseItemInput, PurchaseItemResult, PurchaseResult, RefundResult, RefundSubscriptionInput, RegisterPlayerInput, RegisterPlayerResult, RequestPhoneChangeInput, RequestPhoneChangeResult, SDK_VERSION, SandboxClockResult, SandboxFailureOutcome, SandboxForceAuthChallengeOptions, SandboxForceFailureOptions, SandboxServer, SandboxSubscriptionsServer, ServerConfig, ServerDestinationsQuery, SetPaymentMethodInput, SetPaymentMethodResult, SmsVerifyResult, SteamFinalizeInput, SteamFinalizeResult, SteamFinalizeSubscriptionResult, SteamInitPurchaseInput, SteamInitPurchaseResult, SteamInitResult, SteamPacksQuery, SteamPacksResult, SteamSubscriptionInitInput, type SubscriptionAuthenticationRequiredData, type SubscriptionCanceledData, type SubscriptionEventCommon, type SubscriptionExpiredData, SubscriptionListResult, type SubscriptionPastDueData, type SubscriptionPaymentFailedData, type SubscriptionRefundApprovedData, type SubscriptionRefundDetail, type SubscriptionRefundRejectedData, type SubscriptionRefundRequestData, type SubscriptionRefundedData, type SubscriptionRenewalFunding, type SubscriptionRenewalSplit, type SubscriptionRenewedData, SubscriptionResult, type SubscriptionRevenueShareAttribution, type SubscriptionTrialEventFields, SubscriptionsServer, TransactionStatusResult, type TransferEventData, UpdatePlayerPhoneInput, UpdatePlayerPhoneResult, type VerifyWebhookOptions, type WebhookHandlerOptions, createWebhookHandler, verifyWebhook, verifyWebhookAsync };
|