@invonetwork/web-sdk 3.32.0 → 3.33.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 +1490 -1484
- package/README.md +28 -1
- package/dist/{chunk-RPGRRZFY.js → chunk-DHVHKFQH.js} +58 -5
- package/dist/{chunk-QEJB6HC7.js → chunk-HQLPT2DY.js} +21 -2
- package/dist/{chunk-2XOKKKFR.js → chunk-MJAJXYFX.js} +3 -3
- package/dist/chunk-VWUFSA6U.js +6 -0
- package/dist/game-server.cjs +74 -2
- package/dist/game-server.d.cts +4 -4
- package/dist/game-server.d.ts +4 -4
- package/dist/game-server.js +5 -5
- package/dist/game.cjs +20 -1
- package/dist/game.d.cts +3 -3
- package/dist/game.d.ts +3 -3
- package/dist/game.js +3 -3
- package/dist/{hosted-approval-ICho9KsV.d.ts → hosted-approval-CL3DfrGS.d.ts} +1 -1
- package/dist/{hosted-approval-li0XZFz-.d.cts → hosted-approval-CYqqberu.d.cts} +1 -1
- package/dist/index.cjs +19 -0
- package/dist/index.d.cts +4 -4
- package/dist/index.d.ts +4 -4
- package/dist/index.js +2 -2
- package/dist/{server-jAn9dNM3.d.cts → server-5_g5C-no.d.cts} +13 -2
- package/dist/{server-B-KKg5P0.d.ts → server-Dhao5prR.d.ts} +13 -2
- package/dist/server.cjs +74 -2
- package/dist/server.d.cts +3 -3
- package/dist/server.d.ts +3 -3
- package/dist/server.js +3 -3
- package/dist/{types-CaPHNjOU.d.cts → types-DUfQR48n.d.cts} +45 -3
- package/dist/{types-CaPHNjOU.d.ts → types-DUfQR48n.d.ts} +45 -3
- package/dist/{version-CqwGhQXV.d.cts → version-DKfrEYU1.d.cts} +1 -1
- package/dist/{version-CqwGhQXV.d.ts → version-DKfrEYU1.d.ts} +1 -1
- package/package.json +91 -91
- package/dist/chunk-LVVPRVPU.js +0 -6
package/README.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
First-party TypeScript SDK for integrating **INVO** into partner **web** platforms (storefronts, web games, dashboards). It wraps INVO's web money flows behind a typed, versioned API — the web analog of the Unity/Unreal plugins.
|
|
4
4
|
|
|
5
|
-
> **Status:** `v3.31.0`, stable, published on npm. The backend it wraps is **live** on sandbox + production. The API is covered by a [stability commitment](#stability): no breaking changes without a major bump. Recent highlights: **3.31.0** adds `invoFeeUsd` / `partnerShareUsd` on `platformCommerce.getStatus()` and `getPurchaseHistory()`, `spent_coins_charged_usd` on the coin `purchase.disputed` close (coins already spent are charged to you on a lost dispute), `err.isRateLimited` (every rate-limit 429 now carries `RATE_LIMITED`) and a `Retry-After` header fallback for `err.retryAfter`, and documents dispute holds on both tiers and the $10 payout minimum; **3.23.0** types two optional fields on the `purchase.disputed` close: `dispute_fee_usd` and `dispute_fee_charged_to_partner` (from November 8, 2026 the card dispute fee on Open-tier card sales is passed through to you at cost); **3.22.0** follows INVO's 2026-10 pricing: the Open card fee is **3.5% + $0.30** (was 4.5%), Merchant of Record stays **5.5% + $0.50**; the **chargeback guarantee** is a Merchant of Record term (Open-tier card payments made before November 8, 2026 keep it); payouts to your bank carry a **1% fee, capped at $500 per payout**. New reads: `getPlayerActivity()` / `iteratePlayerActivity()` (one merged list of a player's purchases, sends and transfers) and `platformCommerce.getPurchaseHistory()` / `iteratePurchaseHistory()`; `expiryReason` on `getTransferStatus()` / `getSendStatus()`; typed `transfer.*` and `payout.status_changed` webhook fields; new additive `err.publicCode` (the neutral twin of a code), set to `"BELOW_CARD_MINIMUM"` on the local card-floor refusal, whose `err.code` is unchanged (see [Tiers](#tiers) for the pricing); and the **[player-confirmed phone change](#player-confirmed-phone-change)**: `requestPhoneChange()` / `getPhoneChange()` on the server, `listPhoneChangeApprovals()` / `approvePhoneChange()` on the player's enrolled device, the typed `player.phone_changed` webhook, `err.changeRequestEndpoint` and new phone change error helpers; **3.18.0** follows INVO's 2026-09 card pricing: on card purchases **you pay INVO's card fee** (**4.5% + $0.30** on Open, **5.5% + $0.50** on Merchant of Record, plus **1.5%** on a card issued outside the US) and the player pays the listed price and gets the listed coins; fraud screening and a **chargeback guarantee** are included; minimum card purchase **$2.99** from 2026-10-27. New `partnerFeeUsd`, `internationalCardFeeUsd`, `minPurchaseWarning`, `feeTakenFrom: "partner"`, `err.minUsd` / `err.enforcedFrom` on `err.isBelowCardMinimum`, `minPurchaseWarning` on `createCheckout()`, `country` / `subdivision` on `purchaseCurrency()` with `err.isTaxPlaceUnavailable`, `cardFeeChargedToPartnerUsd` / `partnerDebitedUsd` on Platform Commerce card refunds, and the `partner_fee_usd` / `international_card_fee_usd` / `guarantee_covered` / `card_fee_charged_to_partner_usd` / `partner_debited_usd` webhook fields, all additive; an unacknowledged $10.00 coin purchase now credits 100.00 coins, not 93.70 (see **[Tiers](#tiers)**); **3.17.0** types the Steam fields on `purchase.refunded` / `purchase.disputed` (`rail`, `steam_transid`, nullable card-only ids): Steam chargebacks now arrive as `purchase.disputed`; **3.16.0** adds `warnings` on `createCheckout()` (item metadata on a coin session), `err.isDuplicateClientRequestId`, `err.isTrialAmountBelowFeeFloor` and `err.isIdentityCheckUnavailable`; **3.14.0** adds `credited` / `reasonCode` on `confirmPayment()` and `steamFinalizePurchase()`, Merchant of Record receipt fields, Platform Commerce card refunds in parts, and updates the **[tiers](#tiers)**: subscription card rates and chargeback handling by tier (the rates are superseded by 3.18.0), and Merchant of Record is applied for from the console; **3.13.0** documents the two **[tiers](#tiers)** (Open by default, Merchant of Record by application), adds **[INVO's card fee on coin purchases](#invos-card-fee-quote-show-acknowledge)** (rates superseded by 3.18.0): `quoteCurrencyPurchase()`, `acknowledgedTotalUsd` on `purchaseCurrency()`, the new `processingFeeUsd` / `feeTakenFrom` / `coinsCredited` / `chargeTotalUsd` fields and `err.isAmountBelowFee` / `err.isQuoteStale`, states the coin refund rule (only unspent coins), and adds **[paid trials](#paid-trials)** on card subscriptions (`trialAmountUsd`, the disclosed trial consent fields, `is_trial` / `expire_cause` on the events, `err.isPaymentMethodRequired` and the `isTrialAmount*` helpers); **3.12.0** removes the SDK's own card maximum (INVO's is a runtime setting, $100,000.00 by default); **3.11.0** adds the **[purchase status read](#did-the-purchase-go-through-the-status-read)**, where `invo.checkout.getPurchaseStatus()` / `waitForPurchase()` (and the standalone `CheckoutClient`) answer what happened to a hosted-checkout purchase in six words, four of them terminal, so a buyer is never shown a page that closes on nothing; stopping is decided by INVO's `terminal` and never re-derived from `status`, `nothingWasCharged()` says when a **Try again** is safe, `createCheckout()` now also returns `sessionToken`, and the subscription fee is corrected (it is its own rate; item purchases stay at 10/90; see [Tiers](#tiers) for the current rate); **3.10.0** documents **card-only subscriptions** (the card pays the full price every period, the coin wallet never pays; `walletOnly` deprecated; new `failure_code` `wallet_negative`; a renewal's `purchase.completed` is not a purchase) and the **[subscription refund limits](#refunds)**: `subscriptions.refund` can now return a 202 `pending_approval` refund request (`isRefundPendingApproval`), with `warnings`, the processor fee you bear, `subscriptionCanceled` (a full refund cancels), new classifiers (`isRefundsNotEnabled`, `isRefundWindowClosed`, `isRefundRequestPending`, `isRefundRequestRejected`, `isConcurrentRequest`, `isRefundMismatch`) and typed `subscription.refund_requested` / `refund_approved` / `refund_rejected` events, all additive; **3.9.0** adds the **[INVO-hosted card page for subscriptions](#cards-for-subscriptions)**, `invo.cards.createSetupSession`: mint a 10-minute link server-side, send the member to it, read the card back from `cards.list`, with no browser code and no card processor named anywhere (`beginSetup`/`confirmSetup` remain as the processor-bound alternative), plus the `isPlayerNotFound`, `isInvalidPlayerEmail` and `isInvalidInput` classifiers and a fix that makes `includePlayer` reads actually surface `playerEmail`/`playerName`; **3.8.0** adds **[Subscriptions](#subscriptions-recurring-billing)** as a first-class server surface on both rails: `invo.subscriptions.create/get/listForPlayer/cancel/changeAmount/setPaymentMethod/refund/steamInit/steamFinalize`, the off-session card capture (`invo.cards.beginSetup/confirmSetup/list`), the sandbox clock tools (`invo.sandbox.subscriptions.*`, which post to `/subscriptions/<id>/...` **relative to the sandbox base, not under `/api`**, with the new `sandboxClockKey`), typed `data` for all seven `subscription.*` webhook events, and eleven new error classifiers; **3.7.0** makes the **device approval grant a first-class SDK surface**: `beginDeviceApproval`, `pollDeviceApproval`, `confirmDeviceEnrollment` and, the step that actually moves the money, **`approveWithDeviceCode`** (plus the optional `completeDeviceApproval` loop); a grant that is polled to `approved` and left there settles **nothing**, which is the failure this release exists to make impossible, and `TRANSACTION_NOT_PENDING` now comes back as a typed `status: "not_pending"` result with `alreadySettled` rather than a thrown error you would have to string-match; **3.4.0** documents that a Steam title now bills through **its own Steam application**: the studio registers their appid + publisher Web API key and keeps a payment method on file, because Valve pays the studio and INVO settles afterwards (new `isSteamNotConfigured`, `isPartnerBillingNotSetUp`, `isPartnerSettlementUnavailable`, `isSteamAppChanged` error helpers); **3.2.3** corrects the base path and auth header in the Steam snippets (`/api/currency-purchases`, `X-Game-Secret-Key`); 3.2.2 published both wrong, and copying them returned a 404; **3.2.x** documents **Steam currency purchases on a pack model**: INVO owns the catalogue, you pass a `pack_id` and never a price, and the currency inside a pack varies by country because Steam prices are VAT-inclusive; **3.1.0** makes the authentication guidance explicit: **[passkeys are the gold standard](#passkeys-are-the-gold-standard-dont-build-on-sms)** and the SMS-PIN completion (`verifySmsTransfer`/`verifySmsSend`) is **deprecated and being phased out** (documentation only: no behavior change, no runtime warnings); **3.0.0** moves the Platform Commerce card leg to **INVO's hosted checkout**: the server `purchase()` now returns a `checkoutUrl` and the browser just sends the buyer there (redirect or `mountCheckout` iframe); the 2.5.x card-element surface (`confirmCardPayment`/`mountCardPayment`, `billingAddress`, `commercePublishableKey`) is **removed**; see the [CHANGELOG](CHANGELOG.md) migration note; **2.5.0** added **Platform Commerce** (ecommerce): a platform tenant selling items funded by balance **or** card, with `invo.platformCommerce.purchase/getStatus/refund` (server) and the `platform_commerce.*` webhooks; **2.4.0** adds Steam transfer-policy handling (`isSteamValueNonTransferable`/`isNonSteamValueIntoSteamBlocked` + `DestinationGame.acceptsSteamOriginValue`); **2.3.0** surfaces the claim-time phone-share `409` on `confirmReceipt*`/`claim*` (+ `err.phoneShareLast4`). Full history in the [CHANGELOG](CHANGELOG.md).
|
|
5
|
+
> **Status:** `v3.33.0`, stable, published on npm. The backend it wraps is **live** on sandbox + production. The API is covered by a [stability commitment](#stability): no breaking changes without a major bump. Recent highlights: **3.33.0** adds **[buyer-approved balance purchases](#buyer-approved-balance-purchases)** on Platform Commerce (`requirePlayerApproval`, `getApproval`, `cancelApproval`, the opt-in `platform_commerce.declined` webhook) and `metadata` on the `platform_commerce.*` webhooks; **3.32.0** adds `err.isPaymentsPaused`; **3.31.0** adds `invoFeeUsd` / `partnerShareUsd` on `platformCommerce.getStatus()` and `getPurchaseHistory()`, `spent_coins_charged_usd` on the coin `purchase.disputed` close (coins already spent are charged to you on a lost dispute), `err.isRateLimited` (every rate-limit 429 now carries `RATE_LIMITED`) and a `Retry-After` header fallback for `err.retryAfter`, and documents dispute holds on both tiers and the $10 payout minimum; **3.23.0** types two optional fields on the `purchase.disputed` close: `dispute_fee_usd` and `dispute_fee_charged_to_partner` (from November 8, 2026 the card dispute fee on Open-tier card sales is passed through to you at cost); **3.22.0** follows INVO's 2026-10 pricing: the Open card fee is **3.5% + $0.30** (was 4.5%), Merchant of Record stays **5.5% + $0.50**; the **chargeback guarantee** is a Merchant of Record term (Open-tier card payments made before November 8, 2026 keep it); payouts to your bank carry a **1% fee, capped at $500 per payout**. New reads: `getPlayerActivity()` / `iteratePlayerActivity()` (one merged list of a player's purchases, sends and transfers) and `platformCommerce.getPurchaseHistory()` / `iteratePurchaseHistory()`; `expiryReason` on `getTransferStatus()` / `getSendStatus()`; typed `transfer.*` and `payout.status_changed` webhook fields; new additive `err.publicCode` (the neutral twin of a code), set to `"BELOW_CARD_MINIMUM"` on the local card-floor refusal, whose `err.code` is unchanged (see [Tiers](#tiers) for the pricing); and the **[player-confirmed phone change](#player-confirmed-phone-change)**: `requestPhoneChange()` / `getPhoneChange()` on the server, `listPhoneChangeApprovals()` / `approvePhoneChange()` on the player's enrolled device, the typed `player.phone_changed` webhook, `err.changeRequestEndpoint` and new phone change error helpers; **3.18.0** follows INVO's 2026-09 card pricing: on card purchases **you pay INVO's card fee** (**4.5% + $0.30** on Open, **5.5% + $0.50** on Merchant of Record, plus **1.5%** on a card issued outside the US) and the player pays the listed price and gets the listed coins; fraud screening and a **chargeback guarantee** are included; minimum card purchase **$2.99** from 2026-10-27. New `partnerFeeUsd`, `internationalCardFeeUsd`, `minPurchaseWarning`, `feeTakenFrom: "partner"`, `err.minUsd` / `err.enforcedFrom` on `err.isBelowCardMinimum`, `minPurchaseWarning` on `createCheckout()`, `country` / `subdivision` on `purchaseCurrency()` with `err.isTaxPlaceUnavailable`, `cardFeeChargedToPartnerUsd` / `partnerDebitedUsd` on Platform Commerce card refunds, and the `partner_fee_usd` / `international_card_fee_usd` / `guarantee_covered` / `card_fee_charged_to_partner_usd` / `partner_debited_usd` webhook fields, all additive; an unacknowledged $10.00 coin purchase now credits 100.00 coins, not 93.70 (see **[Tiers](#tiers)**); **3.17.0** types the Steam fields on `purchase.refunded` / `purchase.disputed` (`rail`, `steam_transid`, nullable card-only ids): Steam chargebacks now arrive as `purchase.disputed`; **3.16.0** adds `warnings` on `createCheckout()` (item metadata on a coin session), `err.isDuplicateClientRequestId`, `err.isTrialAmountBelowFeeFloor` and `err.isIdentityCheckUnavailable`; **3.14.0** adds `credited` / `reasonCode` on `confirmPayment()` and `steamFinalizePurchase()`, Merchant of Record receipt fields, Platform Commerce card refunds in parts, and updates the **[tiers](#tiers)**: subscription card rates and chargeback handling by tier (the rates are superseded by 3.18.0), and Merchant of Record is applied for from the console; **3.13.0** documents the two **[tiers](#tiers)** (Open by default, Merchant of Record by application), adds **[INVO's card fee on coin purchases](#invos-card-fee-quote-show-acknowledge)** (rates superseded by 3.18.0): `quoteCurrencyPurchase()`, `acknowledgedTotalUsd` on `purchaseCurrency()`, the new `processingFeeUsd` / `feeTakenFrom` / `coinsCredited` / `chargeTotalUsd` fields and `err.isAmountBelowFee` / `err.isQuoteStale`, states the coin refund rule (only unspent coins), and adds **[paid trials](#paid-trials)** on card subscriptions (`trialAmountUsd`, the disclosed trial consent fields, `is_trial` / `expire_cause` on the events, `err.isPaymentMethodRequired` and the `isTrialAmount*` helpers); **3.12.0** removes the SDK's own card maximum (INVO's is a runtime setting, $100,000.00 by default); **3.11.0** adds the **[purchase status read](#did-the-purchase-go-through-the-status-read)**, where `invo.checkout.getPurchaseStatus()` / `waitForPurchase()` (and the standalone `CheckoutClient`) answer what happened to a hosted-checkout purchase in six words, four of them terminal, so a buyer is never shown a page that closes on nothing; stopping is decided by INVO's `terminal` and never re-derived from `status`, `nothingWasCharged()` says when a **Try again** is safe, `createCheckout()` now also returns `sessionToken`, and the subscription fee is corrected (it is its own rate; item purchases stay at 10/90; see [Tiers](#tiers) for the current rate); **3.10.0** documents **card-only subscriptions** (the card pays the full price every period, the coin wallet never pays; `walletOnly` deprecated; new `failure_code` `wallet_negative`; a renewal's `purchase.completed` is not a purchase) and the **[subscription refund limits](#refunds)**: `subscriptions.refund` can now return a 202 `pending_approval` refund request (`isRefundPendingApproval`), with `warnings`, the processor fee you bear, `subscriptionCanceled` (a full refund cancels), new classifiers (`isRefundsNotEnabled`, `isRefundWindowClosed`, `isRefundRequestPending`, `isRefundRequestRejected`, `isConcurrentRequest`, `isRefundMismatch`) and typed `subscription.refund_requested` / `refund_approved` / `refund_rejected` events, all additive; **3.9.0** adds the **[INVO-hosted card page for subscriptions](#cards-for-subscriptions)**, `invo.cards.createSetupSession`: mint a 10-minute link server-side, send the member to it, read the card back from `cards.list`, with no browser code and no card processor named anywhere (`beginSetup`/`confirmSetup` remain as the processor-bound alternative), plus the `isPlayerNotFound`, `isInvalidPlayerEmail` and `isInvalidInput` classifiers and a fix that makes `includePlayer` reads actually surface `playerEmail`/`playerName`; **3.8.0** adds **[Subscriptions](#subscriptions-recurring-billing)** as a first-class server surface on both rails: `invo.subscriptions.create/get/listForPlayer/cancel/changeAmount/setPaymentMethod/refund/steamInit/steamFinalize`, the off-session card capture (`invo.cards.beginSetup/confirmSetup/list`), the sandbox clock tools (`invo.sandbox.subscriptions.*`, which post to `/subscriptions/<id>/...` **relative to the sandbox base, not under `/api`**, with the new `sandboxClockKey`), typed `data` for all seven `subscription.*` webhook events, and eleven new error classifiers; **3.7.0** makes the **device approval grant a first-class SDK surface**: `beginDeviceApproval`, `pollDeviceApproval`, `confirmDeviceEnrollment` and, the step that actually moves the money, **`approveWithDeviceCode`** (plus the optional `completeDeviceApproval` loop); a grant that is polled to `approved` and left there settles **nothing**, which is the failure this release exists to make impossible, and `TRANSACTION_NOT_PENDING` now comes back as a typed `status: "not_pending"` result with `alreadySettled` rather than a thrown error you would have to string-match; **3.4.0** documents that a Steam title now bills through **its own Steam application**: the studio registers their appid + publisher Web API key and keeps a payment method on file, because Valve pays the studio and INVO settles afterwards (new `isSteamNotConfigured`, `isPartnerBillingNotSetUp`, `isPartnerSettlementUnavailable`, `isSteamAppChanged` error helpers); **3.2.3** corrects the base path and auth header in the Steam snippets (`/api/currency-purchases`, `X-Game-Secret-Key`); 3.2.2 published both wrong, and copying them returned a 404; **3.2.x** documents **Steam currency purchases on a pack model**: INVO owns the catalogue, you pass a `pack_id` and never a price, and the currency inside a pack varies by country because Steam prices are VAT-inclusive; **3.1.0** makes the authentication guidance explicit: **[passkeys are the gold standard](#passkeys-are-the-gold-standard-dont-build-on-sms)** and the SMS-PIN completion (`verifySmsTransfer`/`verifySmsSend`) is **deprecated and being phased out** (documentation only: no behavior change, no runtime warnings); **3.0.0** moves the Platform Commerce card leg to **INVO's hosted checkout**: the server `purchase()` now returns a `checkoutUrl` and the browser just sends the buyer there (redirect or `mountCheckout` iframe); the 2.5.x card-element surface (`confirmCardPayment`/`mountCardPayment`, `billingAddress`, `commercePublishableKey`) is **removed**; see the [CHANGELOG](CHANGELOG.md) migration note; **2.5.0** added **Platform Commerce** (ecommerce): a platform tenant selling items funded by balance **or** card, with `invo.platformCommerce.purchase/getStatus/refund` (server) and the `platform_commerce.*` webhooks; **2.4.0** adds Steam transfer-policy handling (`isSteamValueNonTransferable`/`isNonSteamValueIntoSteamBlocked` + `DestinationGame.acceptsSteamOriginValue`); **2.3.0** surfaces the claim-time phone-share `409` on `confirmReceipt*`/`claim*` (+ `err.phoneShareLast4`). Full history in the [CHANGELOG](CHANGELOG.md).
|
|
6
6
|
> Canonical partner reference: **https://docs.invo.network/docs/currency-purchase** and **https://docs.invo.network/docs/game-developer-integration**.
|
|
7
7
|
|
|
8
8
|
## What it does
|
|
@@ -990,6 +990,33 @@ const handle = invo.platformCommerce.mountCheckout("#checkout", checkoutUrl, {
|
|
|
990
990
|
|
|
991
991
|
> ⚠️ **The card sale is real only on the `platform_commerce.purchased` webhook — never on the client return or the in-frame completion event** (a client can be tampered with). Fulfill on the webhook.
|
|
992
992
|
|
|
993
|
+
### Buyer-approved balance purchases
|
|
994
|
+
|
|
995
|
+
When the buyer's email comes from a public page (a checkout anyone can type into), do not debit on your server's word: ask the buyer to approve. Nothing is debited until they do, on INVO's own page, with their INVO passkey (a buyer without one is emailed a link and sets one up in the same step).
|
|
996
|
+
|
|
997
|
+
```ts
|
|
998
|
+
const r = await server.platformCommerce.purchase({
|
|
999
|
+
clientRequestId: "wc_1001",
|
|
1000
|
+
fundingSource: "balance",
|
|
1001
|
+
playerEmail: "user@example.com",
|
|
1002
|
+
playerName: "Ada",
|
|
1003
|
+
itemId: "sku_1", itemName: "Hat", itemQuantity: 1,
|
|
1004
|
+
unitPrice: "20.00", totalPrice: "20.00",
|
|
1005
|
+
requirePlayerApproval: true,
|
|
1006
|
+
returnUrl: "https://shop.example/order/1001", // optional: the page's "Back to the store" link
|
|
1007
|
+
metadata: { wcOrder: "1001" }, // echoed on every event for this purchase
|
|
1008
|
+
});
|
|
1009
|
+
// r.status === "pending_approval"; send the buyer to r.approvalUrl (redirect, tab or popup).
|
|
1010
|
+
// r.approvalId identifies it; the buyer has 15 minutes. A retry with the same clientRequestId
|
|
1011
|
+
// while it waits returns the same approval with approvalUrl null: keep the first URL.
|
|
1012
|
+
|
|
1013
|
+
const a = await server.platformCommerce.getApproval({ approvalId: r.approvalId! });
|
|
1014
|
+
// a.status: "pending_approval" | "completed" (a.orderId) | "declined" | "expired" | "cancelled" | "failed"
|
|
1015
|
+
await server.platformCommerce.cancelApproval(r.approvalId!); // cart abandoned
|
|
1016
|
+
```
|
|
1017
|
+
|
|
1018
|
+
The sale is final on `platform_commerce.purchased` (it carries `approval_id` and your `metadata`). Every other ending sends **`platform_commerce.declined`** with `status` and `reason` (`declined`, `buyer_cannot_approve`, `expired`, `cancelled`, `insufficient_balance`, `recovery_hold`, `settlement_failed`). That event is **opt-in**: a subscription to all events (`*`) does not receive it, so add it by name. An unknown buyer and a short balance are one answer, `err.isBalanceUnavailable`, and the balance is never disclosed. The card leg ignores the flag (paying by card is the buyer's approval).
|
|
1019
|
+
|
|
993
1020
|
### Status & refunds
|
|
994
1021
|
|
|
995
1022
|
```ts
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { SDK_VERSION } from './chunk-
|
|
2
|
-
import { InvoError, assertSecureBaseUrl, Http, toRequestPhoneChangeResult, toPhoneChangeRequest, toPurchaseStatusResult, receiptFields, creditFields, toLoyaltyCardsResult, buildGameEventBody, toReportGameEventResult, toDestinationsResult } from './chunk-
|
|
1
|
+
import { SDK_VERSION } from './chunk-VWUFSA6U.js';
|
|
2
|
+
import { InvoError, assertSecureBaseUrl, Http, toRequestPhoneChangeResult, toPhoneChangeRequest, toPurchaseStatusResult, receiptFields, creditFields, toLoyaltyCardsResult, buildGameEventBody, toReportGameEventResult, toDestinationsResult } from './chunk-HQLPT2DY.js';
|
|
3
3
|
import { createHmac, timingSafeEqual } from 'crypto';
|
|
4
4
|
|
|
5
5
|
// src/payouts.ts
|
|
@@ -692,6 +692,23 @@ function toPlayerActivityEntry(raw) {
|
|
|
692
692
|
raw
|
|
693
693
|
};
|
|
694
694
|
}
|
|
695
|
+
function toPlatformApproval(raw) {
|
|
696
|
+
const s = (k) => raw[k] == null ? null : String(raw[k]);
|
|
697
|
+
const meta = raw["metadata"];
|
|
698
|
+
return {
|
|
699
|
+
approvalId: String(raw["approval_id"] ?? ""),
|
|
700
|
+
clientRequestId: String(raw["client_request_id"] ?? ""),
|
|
701
|
+
status: String(raw["status"] ?? ""),
|
|
702
|
+
reason: s("reason"),
|
|
703
|
+
totalPrice: s("total_price"),
|
|
704
|
+
orderId: raw["order_id"] ?? null,
|
|
705
|
+
transactionId: s("transaction_id"),
|
|
706
|
+
expiresAt: s("expires_at"),
|
|
707
|
+
decidedAt: s("decided_at"),
|
|
708
|
+
metadata: meta && typeof meta === "object" && !Array.isArray(meta) ? meta : {},
|
|
709
|
+
raw
|
|
710
|
+
};
|
|
711
|
+
}
|
|
695
712
|
function toPlatformOrderStatus(raw, fallbackOrderId) {
|
|
696
713
|
return {
|
|
697
714
|
orderId: raw["order_id"] ?? fallbackOrderId ?? "",
|
|
@@ -998,6 +1015,10 @@ var PlatformCommerceServer = class {
|
|
|
998
1015
|
if (input.successUrl) body["success_url"] = input.successUrl;
|
|
999
1016
|
if (input.cancelUrl) body["cancel_url"] = input.cancelUrl;
|
|
1000
1017
|
if (input.metadata) body["metadata"] = input.metadata;
|
|
1018
|
+
if (input.requirePlayerApproval === true) {
|
|
1019
|
+
body["require_player_approval"] = true;
|
|
1020
|
+
if (input.returnUrl) body["return_url"] = input.returnUrl;
|
|
1021
|
+
}
|
|
1001
1022
|
const raw = await this.http.post(
|
|
1002
1023
|
"/api/platform-commerce/purchase",
|
|
1003
1024
|
body,
|
|
@@ -1006,7 +1027,9 @@ var PlatformCommerceServer = class {
|
|
|
1006
1027
|
{ idempotent: true, signal: opts?.signal }
|
|
1007
1028
|
);
|
|
1008
1029
|
const status = String(raw["status"] ?? "");
|
|
1009
|
-
if (status === "
|
|
1030
|
+
if (status === "pending_approval") {
|
|
1031
|
+
requireField(raw["approval_id"], "approval_id", raw);
|
|
1032
|
+
} else if (status === "requires_payment") {
|
|
1010
1033
|
requireField(raw["checkout_url"], "checkout_url", raw);
|
|
1011
1034
|
} else {
|
|
1012
1035
|
requireField(raw["order_id"], "order_id", raw);
|
|
@@ -1027,9 +1050,39 @@ var PlatformCommerceServer = class {
|
|
|
1027
1050
|
amountUsd: raw["amount_usd"] ?? null,
|
|
1028
1051
|
idempotentReplay: raw["idempotent_replay"] === true,
|
|
1029
1052
|
...minPurchaseWarningField(raw),
|
|
1053
|
+
...raw["approval_id"] != null ? { approvalId: String(raw["approval_id"]) } : {},
|
|
1054
|
+
..."approval_url" in raw ? { approvalUrl: raw["approval_url"] ?? null } : {},
|
|
1030
1055
|
raw
|
|
1031
1056
|
};
|
|
1032
1057
|
}
|
|
1058
|
+
/** Read a buyer-approved purchase (3.33.0) by `approvalId` or by your `clientRequestId`
|
|
1059
|
+
* (exactly one). A fallback to the webhooks: `completed` carries `orderId`; an ending
|
|
1060
|
+
* without a sale carries `reason`. Throws `err.isApprovalNotFound` (404). */
|
|
1061
|
+
async getApproval(key, opts) {
|
|
1062
|
+
const id = key?.approvalId;
|
|
1063
|
+
const crid = key?.clientRequestId;
|
|
1064
|
+
if (Boolean(id) === Boolean(crid)) {
|
|
1065
|
+
throw invalidInput2("approvalId", id, "provide exactly one of approvalId or clientRequestId");
|
|
1066
|
+
}
|
|
1067
|
+
const path = id ? `/api/platform-commerce/approvals/${encodeURIComponent(String(id))}` : `/api/platform-commerce/approvals?${new URLSearchParams({ client_request_id: String(crid) }).toString()}`;
|
|
1068
|
+
const raw = await this.http.get(path, this.auth, { signal: opts?.signal });
|
|
1069
|
+
return toPlatformApproval(raw);
|
|
1070
|
+
}
|
|
1071
|
+
/** Withdraw a buyer-approved purchase that is still waiting (3.33.0).
|
|
1072
|
+
* `platform_commerce.declined` follows with reason `cancelled`. Throws
|
|
1073
|
+
* `err.isApprovalAlreadyEnded` (409) when it had already ended. */
|
|
1074
|
+
async cancelApproval(approvalId, opts) {
|
|
1075
|
+
if (typeof approvalId !== "string" || !approvalId.trim()) {
|
|
1076
|
+
throw invalidInput2("approvalId", approvalId, "is required");
|
|
1077
|
+
}
|
|
1078
|
+
const raw = await this.http.post(
|
|
1079
|
+
`/api/platform-commerce/approvals/${encodeURIComponent(approvalId)}/cancel`,
|
|
1080
|
+
{},
|
|
1081
|
+
this.auth,
|
|
1082
|
+
{ idempotent: true, signal: opts?.signal }
|
|
1083
|
+
);
|
|
1084
|
+
return toPlatformApproval(raw);
|
|
1085
|
+
}
|
|
1033
1086
|
/** Poll an order's status: `completed` (balance immediately; card after the webhook),
|
|
1034
1087
|
* `pending_payment` (card awaiting confirmation), or `refunded`. Once the sale has settled,
|
|
1035
1088
|
* `invoFeeUsd` / `partnerShareUsd` say what INVO kept and what you earned (additive). */
|
|
@@ -3802,5 +3855,5 @@ var InvoServer = class {
|
|
|
3802
3855
|
};
|
|
3803
3856
|
|
|
3804
3857
|
export { CardsServer, DEMO_KEY_PREFIX, EnvironmentUnknownError, InvoServer, PRODUCTION_BASE_URL, PayoutsServer, PlatformCommerceServer, SANDBOX_BASE_URL, SandboxServer, SandboxSubscriptionsServer, SubscriptionsServer, baseUrlForKey, createWebhookHandler, isDemoKey, isRefundPendingApproval, resolveEnvironment, verifyInvoSignature, verifyWebhook, verifyWebhookAsync };
|
|
3805
|
-
//# sourceMappingURL=chunk-
|
|
3806
|
-
//# sourceMappingURL=chunk-
|
|
3858
|
+
//# sourceMappingURL=chunk-DHVHKFQH.js.map
|
|
3859
|
+
//# sourceMappingURL=chunk-DHVHKFQH.js.map
|
|
@@ -345,6 +345,25 @@ var InvoError = class _InvoError extends Error {
|
|
|
345
345
|
get isPaymentsPaused() {
|
|
346
346
|
return this.code === "PAYMENTS_PAUSED";
|
|
347
347
|
}
|
|
348
|
+
/** A buyer-approved balance purchase cannot start (`BALANCE_UNAVAILABLE`, 400; 3.33.0):
|
|
349
|
+
* the buyer is unknown here or their balance is short. One answer on purpose; the
|
|
350
|
+
* balance is never disclosed. Offer another way to pay. */
|
|
351
|
+
get isBalanceUnavailable() {
|
|
352
|
+
return this.code === "BALANCE_UNAVAILABLE";
|
|
353
|
+
}
|
|
354
|
+
/** Buyer approval is not available (`APPROVAL_NOT_AVAILABLE`, 503 or 409; 3.33.0). */
|
|
355
|
+
get isApprovalNotAvailable() {
|
|
356
|
+
return this.code === "APPROVAL_NOT_AVAILABLE";
|
|
357
|
+
}
|
|
358
|
+
/** No buyer-approved purchase with that id in your store (`APPROVAL_NOT_FOUND`, 404). */
|
|
359
|
+
get isApprovalNotFound() {
|
|
360
|
+
return this.code === "APPROVAL_NOT_FOUND";
|
|
361
|
+
}
|
|
362
|
+
/** `cancelApproval` on an approval that already ended (`APPROVAL_ALREADY_ENDED`, 409).
|
|
363
|
+
* Read it with `getApproval`: it may have completed. */
|
|
364
|
+
get isApprovalAlreadyEnded() {
|
|
365
|
+
return this.code === "APPROVAL_ALREADY_ENDED";
|
|
366
|
+
}
|
|
348
367
|
/** True when init-purchase was given a `packId` that is not in INVO's Steam
|
|
349
368
|
* catalogue (`UNKNOWN_STEAM_PACK`, 400). The error body's
|
|
350
369
|
* `valid_pack_ids` lists what exists; re-fetch `steamPacks()` — the
|
|
@@ -1744,5 +1763,5 @@ function toApprovePhoneChangeResult(raw, changeRequestId) {
|
|
|
1744
1763
|
}
|
|
1745
1764
|
|
|
1746
1765
|
export { Http, InvoError, assertSecureBaseUrl, buildGameEventBody, creditFields, isPurchaseCredited, isPurchaseExpired, isPurchaseRefunded, isPurchaseRefused, newEventId, nothingWasCharged, phoneChangeSignalMessage, receiptFields, toApprovePhoneChangeResult, toDestinationsResult, toLoyaltyCardsResult, toLoyaltyVaultResult, toPhoneChangeApprovalsResult, toPhoneChangeRequest, toPurchaseStatusResult, toRedeemRewardResult, toReportGameEventResult, toRequestPhoneChangeResult, toRewardsPageLink };
|
|
1747
|
-
//# sourceMappingURL=chunk-
|
|
1748
|
-
//# sourceMappingURL=chunk-
|
|
1766
|
+
//# sourceMappingURL=chunk-HQLPT2DY.js.map
|
|
1767
|
+
//# sourceMappingURL=chunk-HQLPT2DY.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { InvoError, assertSecureBaseUrl, Http, toPurchaseStatusResult, toPhoneChangeApprovalsResult, phoneChangeSignalMessage, toApprovePhoneChangeResult, toDestinationsResult, toLoyaltyCardsResult, toLoyaltyVaultResult, toRedeemRewardResult, toRewardsPageLink, buildGameEventBody, toReportGameEventResult } from './chunk-
|
|
1
|
+
import { InvoError, assertSecureBaseUrl, Http, toPurchaseStatusResult, toPhoneChangeApprovalsResult, phoneChangeSignalMessage, toApprovePhoneChangeResult, toDestinationsResult, toLoyaltyCardsResult, toLoyaltyVaultResult, toRedeemRewardResult, toRewardsPageLink, buildGameEventBody, toReportGameEventResult } from './chunk-HQLPT2DY.js';
|
|
2
2
|
|
|
3
3
|
// src/shared/webauthn.ts
|
|
4
4
|
function malformedOptions(field) {
|
|
@@ -1586,5 +1586,5 @@ var InvoClient = class {
|
|
|
1586
1586
|
};
|
|
1587
1587
|
|
|
1588
1588
|
export { CheckoutClient, InvoClient, PlatformCommerceClient };
|
|
1589
|
-
//# sourceMappingURL=chunk-
|
|
1590
|
-
//# sourceMappingURL=chunk-
|
|
1589
|
+
//# sourceMappingURL=chunk-MJAJXYFX.js.map
|
|
1590
|
+
//# sourceMappingURL=chunk-MJAJXYFX.js.map
|
package/dist/game-server.cjs
CHANGED
|
@@ -441,6 +441,25 @@ var InvoError = class _InvoError extends Error {
|
|
|
441
441
|
get isPaymentsPaused() {
|
|
442
442
|
return this.code === "PAYMENTS_PAUSED";
|
|
443
443
|
}
|
|
444
|
+
/** A buyer-approved balance purchase cannot start (`BALANCE_UNAVAILABLE`, 400; 3.33.0):
|
|
445
|
+
* the buyer is unknown here or their balance is short. One answer on purpose; the
|
|
446
|
+
* balance is never disclosed. Offer another way to pay. */
|
|
447
|
+
get isBalanceUnavailable() {
|
|
448
|
+
return this.code === "BALANCE_UNAVAILABLE";
|
|
449
|
+
}
|
|
450
|
+
/** Buyer approval is not available (`APPROVAL_NOT_AVAILABLE`, 503 or 409; 3.33.0). */
|
|
451
|
+
get isApprovalNotAvailable() {
|
|
452
|
+
return this.code === "APPROVAL_NOT_AVAILABLE";
|
|
453
|
+
}
|
|
454
|
+
/** No buyer-approved purchase with that id in your store (`APPROVAL_NOT_FOUND`, 404). */
|
|
455
|
+
get isApprovalNotFound() {
|
|
456
|
+
return this.code === "APPROVAL_NOT_FOUND";
|
|
457
|
+
}
|
|
458
|
+
/** `cancelApproval` on an approval that already ended (`APPROVAL_ALREADY_ENDED`, 409).
|
|
459
|
+
* Read it with `getApproval`: it may have completed. */
|
|
460
|
+
get isApprovalAlreadyEnded() {
|
|
461
|
+
return this.code === "APPROVAL_ALREADY_ENDED";
|
|
462
|
+
}
|
|
444
463
|
/** True when init-purchase was given a `packId` that is not in INVO's Steam
|
|
445
464
|
* catalogue (`UNKNOWN_STEAM_PACK`, 400). The error body's
|
|
446
465
|
* `valid_pack_ids` lists what exists; re-fetch `steamPacks()` — the
|
|
@@ -1742,7 +1761,7 @@ function toPhoneChangeRequest(raw) {
|
|
|
1742
1761
|
}
|
|
1743
1762
|
|
|
1744
1763
|
// src/version.ts
|
|
1745
|
-
var SDK_VERSION = "3.
|
|
1764
|
+
var SDK_VERSION = "3.33.0";
|
|
1746
1765
|
|
|
1747
1766
|
// src/payouts.ts
|
|
1748
1767
|
var AMOUNT = /^\d+(\.\d{1,2})?$/;
|
|
@@ -2287,6 +2306,23 @@ function toPlayerActivityEntry(raw) {
|
|
|
2287
2306
|
raw
|
|
2288
2307
|
};
|
|
2289
2308
|
}
|
|
2309
|
+
function toPlatformApproval(raw) {
|
|
2310
|
+
const s = (k) => raw[k] == null ? null : String(raw[k]);
|
|
2311
|
+
const meta = raw["metadata"];
|
|
2312
|
+
return {
|
|
2313
|
+
approvalId: String(raw["approval_id"] ?? ""),
|
|
2314
|
+
clientRequestId: String(raw["client_request_id"] ?? ""),
|
|
2315
|
+
status: String(raw["status"] ?? ""),
|
|
2316
|
+
reason: s("reason"),
|
|
2317
|
+
totalPrice: s("total_price"),
|
|
2318
|
+
orderId: raw["order_id"] ?? null,
|
|
2319
|
+
transactionId: s("transaction_id"),
|
|
2320
|
+
expiresAt: s("expires_at"),
|
|
2321
|
+
decidedAt: s("decided_at"),
|
|
2322
|
+
metadata: meta && typeof meta === "object" && !Array.isArray(meta) ? meta : {},
|
|
2323
|
+
raw
|
|
2324
|
+
};
|
|
2325
|
+
}
|
|
2290
2326
|
function toPlatformOrderStatus(raw, fallbackOrderId) {
|
|
2291
2327
|
return {
|
|
2292
2328
|
orderId: raw["order_id"] ?? fallbackOrderId ?? "",
|
|
@@ -2593,6 +2629,10 @@ var PlatformCommerceServer = class {
|
|
|
2593
2629
|
if (input.successUrl) body["success_url"] = input.successUrl;
|
|
2594
2630
|
if (input.cancelUrl) body["cancel_url"] = input.cancelUrl;
|
|
2595
2631
|
if (input.metadata) body["metadata"] = input.metadata;
|
|
2632
|
+
if (input.requirePlayerApproval === true) {
|
|
2633
|
+
body["require_player_approval"] = true;
|
|
2634
|
+
if (input.returnUrl) body["return_url"] = input.returnUrl;
|
|
2635
|
+
}
|
|
2596
2636
|
const raw = await this.http.post(
|
|
2597
2637
|
"/api/platform-commerce/purchase",
|
|
2598
2638
|
body,
|
|
@@ -2601,7 +2641,9 @@ var PlatformCommerceServer = class {
|
|
|
2601
2641
|
{ idempotent: true, signal: opts?.signal }
|
|
2602
2642
|
);
|
|
2603
2643
|
const status = String(raw["status"] ?? "");
|
|
2604
|
-
if (status === "
|
|
2644
|
+
if (status === "pending_approval") {
|
|
2645
|
+
requireField2(raw["approval_id"], "approval_id", raw);
|
|
2646
|
+
} else if (status === "requires_payment") {
|
|
2605
2647
|
requireField2(raw["checkout_url"], "checkout_url", raw);
|
|
2606
2648
|
} else {
|
|
2607
2649
|
requireField2(raw["order_id"], "order_id", raw);
|
|
@@ -2622,9 +2664,39 @@ var PlatformCommerceServer = class {
|
|
|
2622
2664
|
amountUsd: raw["amount_usd"] ?? null,
|
|
2623
2665
|
idempotentReplay: raw["idempotent_replay"] === true,
|
|
2624
2666
|
...minPurchaseWarningField(raw),
|
|
2667
|
+
...raw["approval_id"] != null ? { approvalId: String(raw["approval_id"]) } : {},
|
|
2668
|
+
..."approval_url" in raw ? { approvalUrl: raw["approval_url"] ?? null } : {},
|
|
2625
2669
|
raw
|
|
2626
2670
|
};
|
|
2627
2671
|
}
|
|
2672
|
+
/** Read a buyer-approved purchase (3.33.0) by `approvalId` or by your `clientRequestId`
|
|
2673
|
+
* (exactly one). A fallback to the webhooks: `completed` carries `orderId`; an ending
|
|
2674
|
+
* without a sale carries `reason`. Throws `err.isApprovalNotFound` (404). */
|
|
2675
|
+
async getApproval(key, opts) {
|
|
2676
|
+
const id = key?.approvalId;
|
|
2677
|
+
const crid = key?.clientRequestId;
|
|
2678
|
+
if (Boolean(id) === Boolean(crid)) {
|
|
2679
|
+
throw invalidInput2("approvalId", id, "provide exactly one of approvalId or clientRequestId");
|
|
2680
|
+
}
|
|
2681
|
+
const path2 = id ? `/api/platform-commerce/approvals/${encodeURIComponent(String(id))}` : `/api/platform-commerce/approvals?${new URLSearchParams({ client_request_id: String(crid) }).toString()}`;
|
|
2682
|
+
const raw = await this.http.get(path2, this.auth, { signal: opts?.signal });
|
|
2683
|
+
return toPlatformApproval(raw);
|
|
2684
|
+
}
|
|
2685
|
+
/** Withdraw a buyer-approved purchase that is still waiting (3.33.0).
|
|
2686
|
+
* `platform_commerce.declined` follows with reason `cancelled`. Throws
|
|
2687
|
+
* `err.isApprovalAlreadyEnded` (409) when it had already ended. */
|
|
2688
|
+
async cancelApproval(approvalId, opts) {
|
|
2689
|
+
if (typeof approvalId !== "string" || !approvalId.trim()) {
|
|
2690
|
+
throw invalidInput2("approvalId", approvalId, "is required");
|
|
2691
|
+
}
|
|
2692
|
+
const raw = await this.http.post(
|
|
2693
|
+
`/api/platform-commerce/approvals/${encodeURIComponent(approvalId)}/cancel`,
|
|
2694
|
+
{},
|
|
2695
|
+
this.auth,
|
|
2696
|
+
{ idempotent: true, signal: opts?.signal }
|
|
2697
|
+
);
|
|
2698
|
+
return toPlatformApproval(raw);
|
|
2699
|
+
}
|
|
2628
2700
|
/** Poll an order's status: `completed` (balance immediately; card after the webhook),
|
|
2629
2701
|
* `pending_payment` (card awaiting confirmation), or `refunded`. Once the sale has settled,
|
|
2630
2702
|
* `invoFeeUsd` / `partnerShareUsd` say what INVO kept and what you earned (additive). */
|
package/dist/game-server.d.cts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { I as InvoServer, a as InvoEnvironment } from './server-
|
|
2
|
-
export { D as DEMO_KEY_PREFIX, E as EnvironmentUnknownError, P as PRODUCTION_BASE_URL, S as SANDBOX_BASE_URL, b as baseUrlForKey, i as isDemoKey, r as resolveEnvironment, v as verifyInvoSignature } from './server-
|
|
1
|
+
import { I as InvoServer, a as InvoEnvironment } from './server-5_g5C-no.cjs';
|
|
2
|
+
export { D as DEMO_KEY_PREFIX, E as EnvironmentUnknownError, P as PRODUCTION_BASE_URL, S as SANDBOX_BASE_URL, b as baseUrlForKey, i as isDemoKey, r as resolveEnvironment, v as verifyInvoSignature } from './server-5_g5C-no.cjs';
|
|
3
3
|
import { G as GameCurrencyKind, a as GamePurchaseStatus, b as GameEconomyConfig } from './types-jUxfYjiD.cjs';
|
|
4
4
|
export { c as GameCatalog, d as GameCatalogItem, e as GameCheckout, f as GameCurrencyBalance, g as GameErrorBody, h as GameItemPurchase, i as GamePlayer, j as GamePremiumPack, k as GamePurchase, l as GameSession, m as GameTransferInput, n as GameTransferKind, o as GameTransferStart, p as GameTransferStatus, q as GameWallet } from './types-jUxfYjiD.cjs';
|
|
5
|
-
export { I as InvoError } from './types-
|
|
6
|
-
export { S as SDK_VERSION } from './version-
|
|
5
|
+
export { I as InvoError } from './types-DUfQR48n.cjs';
|
|
6
|
+
export { S as SDK_VERSION } from './version-DKfrEYU1.cjs';
|
|
7
7
|
import './loyalty-events-CmDw2ZoR.cjs';
|
|
8
8
|
|
|
9
9
|
interface StoredPlayer {
|
package/dist/game-server.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { I as InvoServer, a as InvoEnvironment } from './server-
|
|
2
|
-
export { D as DEMO_KEY_PREFIX, E as EnvironmentUnknownError, P as PRODUCTION_BASE_URL, S as SANDBOX_BASE_URL, b as baseUrlForKey, i as isDemoKey, r as resolveEnvironment, v as verifyInvoSignature } from './server-
|
|
1
|
+
import { I as InvoServer, a as InvoEnvironment } from './server-Dhao5prR.js';
|
|
2
|
+
export { D as DEMO_KEY_PREFIX, E as EnvironmentUnknownError, P as PRODUCTION_BASE_URL, S as SANDBOX_BASE_URL, b as baseUrlForKey, i as isDemoKey, r as resolveEnvironment, v as verifyInvoSignature } from './server-Dhao5prR.js';
|
|
3
3
|
import { G as GameCurrencyKind, a as GamePurchaseStatus, b as GameEconomyConfig } from './types-jUxfYjiD.js';
|
|
4
4
|
export { c as GameCatalog, d as GameCatalogItem, e as GameCheckout, f as GameCurrencyBalance, g as GameErrorBody, h as GameItemPurchase, i as GamePlayer, j as GamePremiumPack, k as GamePurchase, l as GameSession, m as GameTransferInput, n as GameTransferKind, o as GameTransferStart, p as GameTransferStatus, q as GameWallet } from './types-jUxfYjiD.js';
|
|
5
|
-
export { I as InvoError } from './types-
|
|
6
|
-
export { S as SDK_VERSION } from './version-
|
|
5
|
+
export { I as InvoError } from './types-DUfQR48n.js';
|
|
6
|
+
export { S as SDK_VERSION } from './version-DKfrEYU1.js';
|
|
7
7
|
import './loyalty-events-CmDw2ZoR.js';
|
|
8
8
|
|
|
9
9
|
interface StoredPlayer {
|
package/dist/game-server.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { isDemoKey, SANDBOX_BASE_URL, PRODUCTION_BASE_URL, InvoServer, resolveEnvironment, verifyWebhook } from './chunk-
|
|
2
|
-
export { DEMO_KEY_PREFIX, EnvironmentUnknownError, InvoServer, PRODUCTION_BASE_URL, SANDBOX_BASE_URL, baseUrlForKey, isDemoKey, resolveEnvironment, verifyInvoSignature } from './chunk-
|
|
3
|
-
export { SDK_VERSION } from './chunk-
|
|
4
|
-
import { InvoError } from './chunk-
|
|
5
|
-
export { InvoError } from './chunk-
|
|
1
|
+
import { isDemoKey, SANDBOX_BASE_URL, PRODUCTION_BASE_URL, InvoServer, resolveEnvironment, verifyWebhook } from './chunk-DHVHKFQH.js';
|
|
2
|
+
export { DEMO_KEY_PREFIX, EnvironmentUnknownError, InvoServer, PRODUCTION_BASE_URL, SANDBOX_BASE_URL, baseUrlForKey, isDemoKey, resolveEnvironment, verifyInvoSignature } from './chunk-DHVHKFQH.js';
|
|
3
|
+
export { SDK_VERSION } from './chunk-VWUFSA6U.js';
|
|
4
|
+
import { InvoError } from './chunk-HQLPT2DY.js';
|
|
5
|
+
export { InvoError } from './chunk-HQLPT2DY.js';
|
|
6
6
|
import { createHash, randomBytes } from 'crypto';
|
|
7
7
|
import { promises, readFileSync, mkdirSync, writeFileSync } from 'fs';
|
|
8
8
|
import * as path from 'path';
|
package/dist/game.cjs
CHANGED
|
@@ -347,6 +347,25 @@ var InvoError = class _InvoError extends Error {
|
|
|
347
347
|
get isPaymentsPaused() {
|
|
348
348
|
return this.code === "PAYMENTS_PAUSED";
|
|
349
349
|
}
|
|
350
|
+
/** A buyer-approved balance purchase cannot start (`BALANCE_UNAVAILABLE`, 400; 3.33.0):
|
|
351
|
+
* the buyer is unknown here or their balance is short. One answer on purpose; the
|
|
352
|
+
* balance is never disclosed. Offer another way to pay. */
|
|
353
|
+
get isBalanceUnavailable() {
|
|
354
|
+
return this.code === "BALANCE_UNAVAILABLE";
|
|
355
|
+
}
|
|
356
|
+
/** Buyer approval is not available (`APPROVAL_NOT_AVAILABLE`, 503 or 409; 3.33.0). */
|
|
357
|
+
get isApprovalNotAvailable() {
|
|
358
|
+
return this.code === "APPROVAL_NOT_AVAILABLE";
|
|
359
|
+
}
|
|
360
|
+
/** No buyer-approved purchase with that id in your store (`APPROVAL_NOT_FOUND`, 404). */
|
|
361
|
+
get isApprovalNotFound() {
|
|
362
|
+
return this.code === "APPROVAL_NOT_FOUND";
|
|
363
|
+
}
|
|
364
|
+
/** `cancelApproval` on an approval that already ended (`APPROVAL_ALREADY_ENDED`, 409).
|
|
365
|
+
* Read it with `getApproval`: it may have completed. */
|
|
366
|
+
get isApprovalAlreadyEnded() {
|
|
367
|
+
return this.code === "APPROVAL_ALREADY_ENDED";
|
|
368
|
+
}
|
|
350
369
|
/** True when init-purchase was given a `packId` that is not in INVO's Steam
|
|
351
370
|
* catalogue (`UNKNOWN_STEAM_PACK`, 400). The error body's
|
|
352
371
|
* `valid_pack_ids` lists what exists; re-fetch `steamPacks()` — the
|
|
@@ -4864,7 +4883,7 @@ function mountInvoUI(container, economy, options = {}) {
|
|
|
4864
4883
|
}
|
|
4865
4884
|
|
|
4866
4885
|
// src/version.ts
|
|
4867
|
-
var SDK_VERSION = "3.
|
|
4886
|
+
var SDK_VERSION = "3.33.0";
|
|
4868
4887
|
|
|
4869
4888
|
exports.InvoGameEconomy = InvoGameEconomy;
|
|
4870
4889
|
exports.InvoGameError = InvoGameError;
|
package/dist/game.d.cts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { i as GamePlayer, q as GameWallet, c as GameCatalog, k as GamePurchase, h as GameItemPurchase, n as GameTransferKind, d as GameCatalogItem, f as GameCurrencyBalance, p as GameTransferStatus, m as GameTransferInput, o as GameTransferStart } from './types-jUxfYjiD.cjs';
|
|
2
2
|
export { e as GameCheckout, G as GameCurrencyKind, b as GameEconomyConfig, g as GameErrorBody, j as GamePremiumPack, a as GamePurchaseStatus, l as GameSession } from './types-jUxfYjiD.cjs';
|
|
3
|
-
import { A as ApproveHostedResult } from './hosted-approval-
|
|
4
|
-
import { D as DestinationGame, P as PendingCollectItem } from './types-
|
|
5
|
-
export { S as SDK_VERSION } from './version-
|
|
3
|
+
import { A as ApproveHostedResult } from './hosted-approval-CYqqberu.cjs';
|
|
4
|
+
import { D as DestinationGame, P as PendingCollectItem } from './types-DUfQR48n.cjs';
|
|
5
|
+
export { S as SDK_VERSION } from './version-DKfrEYU1.cjs';
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
8
|
* INVO game economy client (3.27.0), the browser half. It talks ONLY to your game server
|
package/dist/game.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { i as GamePlayer, q as GameWallet, c as GameCatalog, k as GamePurchase, h as GameItemPurchase, n as GameTransferKind, d as GameCatalogItem, f as GameCurrencyBalance, p as GameTransferStatus, m as GameTransferInput, o as GameTransferStart } from './types-jUxfYjiD.js';
|
|
2
2
|
export { e as GameCheckout, G as GameCurrencyKind, b as GameEconomyConfig, g as GameErrorBody, j as GamePremiumPack, a as GamePurchaseStatus, l as GameSession } from './types-jUxfYjiD.js';
|
|
3
|
-
import { A as ApproveHostedResult } from './hosted-approval-
|
|
4
|
-
import { D as DestinationGame, P as PendingCollectItem } from './types-
|
|
5
|
-
export { S as SDK_VERSION } from './version-
|
|
3
|
+
import { A as ApproveHostedResult } from './hosted-approval-CL3DfrGS.js';
|
|
4
|
+
import { D as DestinationGame, P as PendingCollectItem } from './types-DUfQR48n.js';
|
|
5
|
+
export { S as SDK_VERSION } from './version-DKfrEYU1.js';
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
8
|
* INVO game economy client (3.27.0), the browser half. It talks ONLY to your game server
|
package/dist/game.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { InvoClient } from './chunk-
|
|
2
|
-
export { SDK_VERSION } from './chunk-
|
|
3
|
-
import { newEventId } from './chunk-
|
|
1
|
+
import { InvoClient } from './chunk-MJAJXYFX.js';
|
|
2
|
+
export { SDK_VERSION } from './chunk-VWUFSA6U.js';
|
|
3
|
+
import { newEventId } from './chunk-HQLPT2DY.js';
|
|
4
4
|
|
|
5
5
|
// src/game/client.ts
|
|
6
6
|
var InvoGameError = class extends Error {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { A as ApproveResult, j as ConfirmReceiptResult } from './types-
|
|
1
|
+
import { A as ApproveResult, j as ConfirmReceiptResult } from './types-DUfQR48n.js';
|
|
2
2
|
|
|
3
3
|
/** The four device-approval flows (`begin.flow`). */
|
|
4
4
|
type HostedFlow = "transfer" | "send" | "send_receipt" | "transfer_receipt";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { A as ApproveResult, j as ConfirmReceiptResult } from './types-
|
|
1
|
+
import { A as ApproveResult, j as ConfirmReceiptResult } from './types-DUfQR48n.cjs';
|
|
2
2
|
|
|
3
3
|
/** The four device-approval flows (`begin.flow`). */
|
|
4
4
|
type HostedFlow = "transfer" | "send" | "send_receipt" | "transfer_receipt";
|
package/dist/index.cjs
CHANGED
|
@@ -347,6 +347,25 @@ var InvoError = class _InvoError extends Error {
|
|
|
347
347
|
get isPaymentsPaused() {
|
|
348
348
|
return this.code === "PAYMENTS_PAUSED";
|
|
349
349
|
}
|
|
350
|
+
/** A buyer-approved balance purchase cannot start (`BALANCE_UNAVAILABLE`, 400; 3.33.0):
|
|
351
|
+
* the buyer is unknown here or their balance is short. One answer on purpose; the
|
|
352
|
+
* balance is never disclosed. Offer another way to pay. */
|
|
353
|
+
get isBalanceUnavailable() {
|
|
354
|
+
return this.code === "BALANCE_UNAVAILABLE";
|
|
355
|
+
}
|
|
356
|
+
/** Buyer approval is not available (`APPROVAL_NOT_AVAILABLE`, 503 or 409; 3.33.0). */
|
|
357
|
+
get isApprovalNotAvailable() {
|
|
358
|
+
return this.code === "APPROVAL_NOT_AVAILABLE";
|
|
359
|
+
}
|
|
360
|
+
/** No buyer-approved purchase with that id in your store (`APPROVAL_NOT_FOUND`, 404). */
|
|
361
|
+
get isApprovalNotFound() {
|
|
362
|
+
return this.code === "APPROVAL_NOT_FOUND";
|
|
363
|
+
}
|
|
364
|
+
/** `cancelApproval` on an approval that already ended (`APPROVAL_ALREADY_ENDED`, 409).
|
|
365
|
+
* Read it with `getApproval`: it may have completed. */
|
|
366
|
+
get isApprovalAlreadyEnded() {
|
|
367
|
+
return this.code === "APPROVAL_ALREADY_ENDED";
|
|
368
|
+
}
|
|
350
369
|
/** True when init-purchase was given a `packId` that is not in INVO's Steam
|
|
351
370
|
* catalogue (`UNKNOWN_STEAM_PACK`, 400). The error body's
|
|
352
371
|
* `valid_pack_ids` lists what exists; re-fetch `steamPacks()` — the
|
package/dist/index.d.cts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { a as PurchaseStatusResult, b as PurchaseCredited, c as PurchaseExpired, d as PurchaseRefunded, e as PurchaseRefused, C as CheckoutClientConfig, H as Http, f as PurchaseStatusInput, g as CallOptions, W as WaitForPurchaseInput, M as MountCheckoutOptions, h as CheckoutMountHandle, i as ClientConfig, A as ApproveResult, j as ConfirmReceiptResult, k as PhoneChangeApprovalsResult, l as ApprovePhoneChangeInput, m as ApprovePhoneChangeResult, L as LinkDeviceResult, n as PendingCollectResult, o as DestinationsQuery, p as DestinationsResult, B as BalanceResult, q as LoyaltyCardsResult, r as LoyaltyVaultResult, R as RedeemRewardResult, s as RewardsPageLink, E as EnrollmentBeginResult, t as EnrollmentVerifyResult, u as RecoveryBeginResult, v as RecoveryCompleteResult } from './types-
|
|
2
|
-
export { w as BalanceRow, x as CheckoutPurchaseStatus, y as ClaimDelivery, D as DestinationGame, I as InvoError, z as InvoErrorInfo, F as InvoHooks, G as InvoRequestInfo, J as InvoResponseInfo, K as LoyaltyCard, N as LoyaltyCardReward, O as LoyaltyCardStep, Q as LoyaltyRewardState, S as LoyaltyStepProgress, T as LoyaltyStepState, U as LoyaltyVaultEntry, P as PendingCollectItem, V as PhoneChangeApproval, X as PhoneChangeDeviceSignal, Y as PurchaseRefusalReason, Z as Rail, _ as VerificationMethod } from './types-
|
|
3
|
-
import { a as ApproveHostedOptions, A as ApproveHostedResult } from './hosted-approval-
|
|
4
|
-
export { E as EnrollmentDecision, b as EnrollmentRespond, H as HostedApprovalStatus, c as HostedEnrollment, d as HostedEnrollmentInput, e as HostedFlow } from './hosted-approval-
|
|
1
|
+
import { a as PurchaseStatusResult, b as PurchaseCredited, c as PurchaseExpired, d as PurchaseRefunded, e as PurchaseRefused, C as CheckoutClientConfig, H as Http, f as PurchaseStatusInput, g as CallOptions, W as WaitForPurchaseInput, M as MountCheckoutOptions, h as CheckoutMountHandle, i as ClientConfig, A as ApproveResult, j as ConfirmReceiptResult, k as PhoneChangeApprovalsResult, l as ApprovePhoneChangeInput, m as ApprovePhoneChangeResult, L as LinkDeviceResult, n as PendingCollectResult, o as DestinationsQuery, p as DestinationsResult, B as BalanceResult, q as LoyaltyCardsResult, r as LoyaltyVaultResult, R as RedeemRewardResult, s as RewardsPageLink, E as EnrollmentBeginResult, t as EnrollmentVerifyResult, u as RecoveryBeginResult, v as RecoveryCompleteResult } from './types-DUfQR48n.cjs';
|
|
2
|
+
export { w as BalanceRow, x as CheckoutPurchaseStatus, y as ClaimDelivery, D as DestinationGame, I as InvoError, z as InvoErrorInfo, F as InvoHooks, G as InvoRequestInfo, J as InvoResponseInfo, K as LoyaltyCard, N as LoyaltyCardReward, O as LoyaltyCardStep, Q as LoyaltyRewardState, S as LoyaltyStepProgress, T as LoyaltyStepState, U as LoyaltyVaultEntry, P as PendingCollectItem, V as PhoneChangeApproval, X as PhoneChangeDeviceSignal, Y as PurchaseRefusalReason, Z as Rail, _ as VerificationMethod } from './types-DUfQR48n.cjs';
|
|
3
|
+
import { a as ApproveHostedOptions, A as ApproveHostedResult } from './hosted-approval-CYqqberu.cjs';
|
|
4
|
+
export { E as EnrollmentDecision, b as EnrollmentRespond, H as HostedApprovalStatus, c as HostedEnrollment, d as HostedEnrollmentInput, e as HostedFlow } from './hosted-approval-CYqqberu.cjs';
|
|
5
5
|
import { R as ReportGameEventInput, a as ReportGameEventResult } from './loyalty-events-CmDw2ZoR.cjs';
|
|
6
6
|
export { G as GameEventType } from './loyalty-events-CmDw2ZoR.cjs';
|
|
7
7
|
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { a as PurchaseStatusResult, b as PurchaseCredited, c as PurchaseExpired, d as PurchaseRefunded, e as PurchaseRefused, C as CheckoutClientConfig, H as Http, f as PurchaseStatusInput, g as CallOptions, W as WaitForPurchaseInput, M as MountCheckoutOptions, h as CheckoutMountHandle, i as ClientConfig, A as ApproveResult, j as ConfirmReceiptResult, k as PhoneChangeApprovalsResult, l as ApprovePhoneChangeInput, m as ApprovePhoneChangeResult, L as LinkDeviceResult, n as PendingCollectResult, o as DestinationsQuery, p as DestinationsResult, B as BalanceResult, q as LoyaltyCardsResult, r as LoyaltyVaultResult, R as RedeemRewardResult, s as RewardsPageLink, E as EnrollmentBeginResult, t as EnrollmentVerifyResult, u as RecoveryBeginResult, v as RecoveryCompleteResult } from './types-
|
|
2
|
-
export { w as BalanceRow, x as CheckoutPurchaseStatus, y as ClaimDelivery, D as DestinationGame, I as InvoError, z as InvoErrorInfo, F as InvoHooks, G as InvoRequestInfo, J as InvoResponseInfo, K as LoyaltyCard, N as LoyaltyCardReward, O as LoyaltyCardStep, Q as LoyaltyRewardState, S as LoyaltyStepProgress, T as LoyaltyStepState, U as LoyaltyVaultEntry, P as PendingCollectItem, V as PhoneChangeApproval, X as PhoneChangeDeviceSignal, Y as PurchaseRefusalReason, Z as Rail, _ as VerificationMethod } from './types-
|
|
3
|
-
import { a as ApproveHostedOptions, A as ApproveHostedResult } from './hosted-approval-
|
|
4
|
-
export { E as EnrollmentDecision, b as EnrollmentRespond, H as HostedApprovalStatus, c as HostedEnrollment, d as HostedEnrollmentInput, e as HostedFlow } from './hosted-approval-
|
|
1
|
+
import { a as PurchaseStatusResult, b as PurchaseCredited, c as PurchaseExpired, d as PurchaseRefunded, e as PurchaseRefused, C as CheckoutClientConfig, H as Http, f as PurchaseStatusInput, g as CallOptions, W as WaitForPurchaseInput, M as MountCheckoutOptions, h as CheckoutMountHandle, i as ClientConfig, A as ApproveResult, j as ConfirmReceiptResult, k as PhoneChangeApprovalsResult, l as ApprovePhoneChangeInput, m as ApprovePhoneChangeResult, L as LinkDeviceResult, n as PendingCollectResult, o as DestinationsQuery, p as DestinationsResult, B as BalanceResult, q as LoyaltyCardsResult, r as LoyaltyVaultResult, R as RedeemRewardResult, s as RewardsPageLink, E as EnrollmentBeginResult, t as EnrollmentVerifyResult, u as RecoveryBeginResult, v as RecoveryCompleteResult } from './types-DUfQR48n.js';
|
|
2
|
+
export { w as BalanceRow, x as CheckoutPurchaseStatus, y as ClaimDelivery, D as DestinationGame, I as InvoError, z as InvoErrorInfo, F as InvoHooks, G as InvoRequestInfo, J as InvoResponseInfo, K as LoyaltyCard, N as LoyaltyCardReward, O as LoyaltyCardStep, Q as LoyaltyRewardState, S as LoyaltyStepProgress, T as LoyaltyStepState, U as LoyaltyVaultEntry, P as PendingCollectItem, V as PhoneChangeApproval, X as PhoneChangeDeviceSignal, Y as PurchaseRefusalReason, Z as Rail, _ as VerificationMethod } from './types-DUfQR48n.js';
|
|
3
|
+
import { a as ApproveHostedOptions, A as ApproveHostedResult } from './hosted-approval-CL3DfrGS.js';
|
|
4
|
+
export { E as EnrollmentDecision, b as EnrollmentRespond, H as HostedApprovalStatus, c as HostedEnrollment, d as HostedEnrollmentInput, e as HostedFlow } from './hosted-approval-CL3DfrGS.js';
|
|
5
5
|
import { R as ReportGameEventInput, a as ReportGameEventResult } from './loyalty-events-CmDw2ZoR.js';
|
|
6
6
|
export { G as GameEventType } from './loyalty-events-CmDw2ZoR.js';
|
|
7
7
|
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { CheckoutClient, InvoClient, PlatformCommerceClient } from './chunk-
|
|
2
|
-
export { InvoError, isPurchaseCredited, isPurchaseExpired, isPurchaseRefunded, isPurchaseRefused, nothingWasCharged, phoneChangeSignalMessage } from './chunk-
|
|
1
|
+
export { CheckoutClient, InvoClient, PlatformCommerceClient } from './chunk-MJAJXYFX.js';
|
|
2
|
+
export { InvoError, isPurchaseCredited, isPurchaseExpired, isPurchaseRefunded, isPurchaseRefused, nothingWasCharged, phoneChangeSignalMessage } from './chunk-HQLPT2DY.js';
|
|
3
3
|
//# sourceMappingURL=index.js.map
|
|
4
4
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { I as InvoError, H as Http, $ as AuthHeader, g as CallOptions, a0 as PlatformPurchaseInput, a1 as PlatformPurchaseResult, a2 as
|
|
1
|
+
import { I as InvoError, H as Http, $ as AuthHeader, g as CallOptions, a0 as PlatformPurchaseInput, a1 as PlatformPurchaseResult, a2 as PlatformApprovalResult, a3 as PlatformOrderStatusResult, a4 as PlatformPurchaseHistoryQuery, a5 as PlatformPurchaseHistoryResult, a6 as PlatformRefundInput, a7 as PlatformRefundResult, a8 as CreateSubscriptionInput, a9 as SubscriptionResult, aa as GetSubscriptionOptions, ab as GetSubscriptionResult, ac as ListSubscriptionsOptions, ad as SubscriptionListResult, ae as CancelSubscriptionOptions, af as CancelResult, ag as ChangeAmountResult, ah as SetPaymentMethodInput, ai as SetPaymentMethodResult, aj as RefundSubscriptionInput, ak as RefundResult, al as SteamSubscriptionInitInput, am as SteamInitResult, an as SteamFinalizeSubscriptionResult, ao as CardSetupSessionInput, ap as CardSetupSessionResult, aq as CardSetupInput, ar as CardSetupResult, as as CardSetupConfirmInput, at as CardSetupConfirmResult, au as PlayerCardsResult, av as SandboxClockResult, aw as SandboxFailureOutcome, ax as SandboxForceFailureOptions, ay as SandboxForceAuthChallengeOptions, az as ServerConfig, aA as MintPlayerTokenInput, aB as PlayerToken, aC as RegisterPlayerInput, aD as RegisterPlayerResult, aE as UpdatePlayerPhoneInput, aF as UpdatePlayerPhoneResult, aG as RequestPhoneChangeInput, aH as RequestPhoneChangeResult, aI as PhoneChangeRequest, aJ as InitiateSendInput, aK as InitiateResult, aL as InitiateTransferInput, aM as CreateCheckoutInput, aN as CreateCheckoutResult, a as PurchaseStatusResult, aO as PurchaseInput, aP as PurchaseResult, aQ as CurrencyPurchaseQuoteInput, aR as CurrencyPurchaseQuote, aS as ConfirmPaymentResult, aT as OrderDetailsResult, aU as SteamPacksQuery, aV as SteamPacksResult, aW as SteamInitPurchaseInput, aX as SteamInitPurchaseResult, aY as SteamFinalizeInput, aZ as SteamFinalizeResult, a_ as PurchaseItemInput, a$ as PurchaseItemResult, b0 as ItemHistoryQuery, b1 as ItemHistoryResult, b2 as ItemOrderQuery, b3 as PlayerActivityQuery, b4 as PlayerActivityResult, b5 as PlayerActivityEntry, b6 as PlayerBalanceQuery, b7 as PlayerBalanceResult, q as LoyaltyCardsResult, b8 as InboundPendingQuery, b9 as InboundPendingResult, ba as LinkedIdentitiesQuery, bb as LinkedIdentitiesResult, bc as SmsVerifyResult, bd as ClaimTransferInput, be as ClaimResult, bf as ClaimCurrencyInput, bg as TransactionStatusResult, bh as GuardianApprovalStatusResult, bi as ServerDestinationsQuery, p as DestinationsResult, bj as PhoneShareContact, bk as PhoneShareInitiateResult, bl as PhoneShareApproveInput, bm as PhoneShareApproveResult, bn as PhoneShareStatusResult, bo as BeginDeviceApprovalInput, bp as DeviceApprovalGrant, bq as PollDeviceApprovalInput, br as DeviceApprovalPollResult, bs as ConfirmDeviceEnrollmentInput, bt as ConfirmDeviceEnrollmentResult, bu as ApproveWithDeviceCodeInput, bv as DeviceApprovalSettleResult, bw as CompleteDeviceApprovalInput, bx as CompleteDeviceApprovalResult } from './types-DUfQR48n.cjs';
|
|
2
2
|
import { b as ReportServerGameEventInput, a as ReportGameEventResult } from './loyalty-events-CmDw2ZoR.cjs';
|
|
3
|
-
import './version-
|
|
3
|
+
import './version-DKfrEYU1.cjs';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* Pick the INVO environment from the game secret alone (3.28.0).
|
|
@@ -1207,6 +1207,17 @@ declare class PlatformCommerceServer {
|
|
|
1207
1207
|
* `err.isNotPlatformTenant` (403).
|
|
1208
1208
|
*/
|
|
1209
1209
|
purchase(input: PlatformPurchaseInput, opts?: CallOptions): Promise<PlatformPurchaseResult>;
|
|
1210
|
+
/** Read a buyer-approved purchase (3.33.0) by `approvalId` or by your `clientRequestId`
|
|
1211
|
+
* (exactly one). A fallback to the webhooks: `completed` carries `orderId`; an ending
|
|
1212
|
+
* without a sale carries `reason`. Throws `err.isApprovalNotFound` (404). */
|
|
1213
|
+
getApproval(key: {
|
|
1214
|
+
approvalId?: string;
|
|
1215
|
+
clientRequestId?: string;
|
|
1216
|
+
}, opts?: CallOptions): Promise<PlatformApprovalResult>;
|
|
1217
|
+
/** Withdraw a buyer-approved purchase that is still waiting (3.33.0).
|
|
1218
|
+
* `platform_commerce.declined` follows with reason `cancelled`. Throws
|
|
1219
|
+
* `err.isApprovalAlreadyEnded` (409) when it had already ended. */
|
|
1220
|
+
cancelApproval(approvalId: string, opts?: CallOptions): Promise<PlatformApprovalResult>;
|
|
1210
1221
|
/** Poll an order's status: `completed` (balance immediately; card after the webhook),
|
|
1211
1222
|
* `pending_payment` (card awaiting confirmation), or `refunded`. Once the sale has settled,
|
|
1212
1223
|
* `invoFeeUsd` / `partnerShareUsd` say what INVO kept and what you earned (additive). */
|