@invonetwork/web-sdk 3.16.1 → 3.18.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/dist/server.cjs CHANGED
@@ -379,11 +379,38 @@ var InvoError = class _InvoError extends Error {
379
379
  const st = String(b["steam_status"] ?? "").toLowerCase();
380
380
  return st !== "init" && st !== "";
381
381
  }
382
- /** True if a Platform Commerce CARD purchase was below the processor's floor of $0.50
383
- * (backend code `BELOW_STRIPE_MINIMUM`, 400). Neutral name; matches the wire code. */
382
+ /**
383
+ * True if a CARD purchase was below the card minimum (`BELOW_CARD_MINIMUM`, 400). Nothing
384
+ * was charged. Two floors answer with this code:
385
+ * - INVO's minimum card purchase, $2.99 by default, on coin purchases and Platform Commerce
386
+ * card sales (not subscriptions), enforced from 2026-10-27. Until that date a smaller
387
+ * purchase is accepted and the response carries `minPurchaseWarning` instead.
388
+ * {@link minUsd} and {@link enforcedFrom} carry the figures in force; the amount and the
389
+ * date are INVO settings, so read them from the error rather than hard-coding them.
390
+ * - the card rail's own floor of $0.50, at any date, on coin purchases (the direct route and
391
+ * hosted checkout session create, complete and create-intent) and Platform Commerce card
392
+ * purchases ({@link minUsd} reads `"0.50"` there, with no {@link enforcedFrom}).
393
+ * {@link minUsd} tells you which floor refused it.
394
+ *
395
+ * Card purchases only; purchases through a third-party storefront or payment rail are
396
+ * unaffected. Raise the amount; do not retry it unchanged.
397
+ */
384
398
  get isBelowCardMinimum() {
385
399
  return this.code === "BELOW_CARD_MINIMUM" || this.rawCode === "BELOW_STRIPE_MINIMUM";
386
400
  }
401
+ /** On `BELOW_CARD_MINIMUM`: the minimum card purchase in force (`min_usd`), USD decimal
402
+ * string, for example `"2.99"`. `undefined` when the body does not carry it. */
403
+ get minUsd() {
404
+ const v = this.bodyObject()["min_usd"];
405
+ if (typeof v === "number" && Number.isFinite(v)) return v.toFixed(2);
406
+ return typeof v === "string" && v ? v : void 0;
407
+ }
408
+ /** On `BELOW_CARD_MINIMUM`: the date INVO started enforcing the minimum card purchase
409
+ * (`enforced_from`), ISO 8601, for example `"2026-10-27"`. `undefined` when absent. */
410
+ get enforcedFrom() {
411
+ const v = this.bodyObject()["enforced_from"];
412
+ return typeof v === "string" && v ? v : void 0;
413
+ }
387
414
  /** True if a CARD purchase exceeded INVO's maximum single card charge
388
415
  * (`ABOVE_CARD_MAXIMUM`, 400) — split the sale or lower the amount. Do not retry it
389
416
  * unchanged; nothing was charged.
@@ -398,18 +425,22 @@ var InvoError = class _InvoError extends Error {
398
425
  }
399
426
  // ---- Coin purchase: INVO's card fee (2026-09-23) ----
400
427
  /**
401
- * True when an UNACKNOWLEDGED `purchaseCurrency` was refused because the amount is too
402
- * small to carry INVO's card fee (`AMOUNT_BELOW_FEE`, 400). Nothing was charged. Send a
403
- * larger amount, or quote it with `quoteCurrencyPurchase` and send `acknowledgedTotalUsd`
404
- * so the fee is added on top.
428
+ * True when an UNACKNOWLEDGED `purchaseCurrency` was refused because the amount was too
429
+ * small to carry INVO's card fee (`AMOUNT_BELOW_FEE`, 400). Nothing was charged.
430
+ *
431
+ * @deprecated No longer returned: under the 2026-09 pricing the partner pays the card fee,
432
+ * so it is never in the buyer's charge. Kept so existing code still compiles; a small card
433
+ * purchase now answers `BELOW_CARD_MINIMUM` ({@link isBelowCardMinimum}).
405
434
  */
406
435
  get isAmountBelowFee() {
407
436
  return this.code === "AMOUNT_BELOW_FEE";
408
437
  }
409
438
  /**
410
- * True when `purchaseCurrency` was sent an `acknowledgedTotalUsd` that is not the total
411
- * INVO would charge now (`QUOTE_STALE`, 409). Nothing was charged. Quote again, show the
412
- * player the new total, and retry with it. {@link expectedTotalUsd} carries INVO's figure.
439
+ * True when `purchaseCurrency` was sent an `acknowledgedTotalUsd` BELOW the total INVO would
440
+ * charge now (`QUOTE_STALE`, 409). Nothing was charged. Quote again, show the player the new
441
+ * total, and retry with it. {@link expectedTotalUsd} carries INVO's figure. A higher
442
+ * acknowledged total (for example an older fee-inclusive one) is not refused: INVO charges
443
+ * the true, lower total.
413
444
  */
414
445
  get isQuoteStale() {
415
446
  return this.code === "QUOTE_STALE";
@@ -419,11 +450,28 @@ var InvoError = class _InvoError extends Error {
419
450
  const v = this.bodyObject()["expected_total_usd"];
420
451
  return typeof v === "string" && v ? v : void 0;
421
452
  }
422
- /** On `QUOTE_STALE`: the total you sent, as INVO read it (`acknowledged_total_usd`). */
453
+ /** On `QUOTE_STALE` or `TAX_PLACE_UNAVAILABLE`: the total you sent, as INVO read it
454
+ * (`acknowledged_total_usd`). */
423
455
  get acknowledgedTotalUsd() {
424
456
  const v = this.bodyObject()["acknowledged_total_usd"];
425
457
  return typeof v === "string" && v ? v : void 0;
426
458
  }
459
+ /**
460
+ * True when a Merchant of Record `purchaseCurrency` acknowledged a taxed total but INVO could
461
+ * not read the buyer's tax location from the card on this attempt, and the request carried no
462
+ * `country` to fall back on (`TAX_PLACE_UNAVAILABLE`, 409). Nothing was charged. Retry the
463
+ * purchase (a fresh attempt usually reads the card), or send the `country` (and
464
+ * `subdivision`) you quoted with. INVO never drops the tax a buyer was shown, so it refuses
465
+ * rather than charging a different figure. The body carries `retryable: true`.
466
+ */
467
+ get isTaxPlaceUnavailable() {
468
+ return this.code === "TAX_PLACE_UNAVAILABLE";
469
+ }
470
+ /** On `TAX_PLACE_UNAVAILABLE`: the total without tax (`untaxed_total_usd`), decimal string. */
471
+ get untaxedTotalUsd() {
472
+ const v = this.bodyObject()["untaxed_total_usd"];
473
+ return typeof v === "string" && v ? v : void 0;
474
+ }
427
475
  /**
428
476
  * True if a Platform Commerce refund targeted an order that was already refunded
429
477
  * (409). Idempotent outcome — the original refund did happen, so treat this as
@@ -1138,7 +1186,7 @@ function receiptFields(raw) {
1138
1186
  }
1139
1187
 
1140
1188
  // src/version.ts
1141
- var SDK_VERSION = "3.16.1";
1189
+ var SDK_VERSION = "3.17.0";
1142
1190
 
1143
1191
  // src/shared/types.ts
1144
1192
  function isRefundPendingApproval(r) {
@@ -1319,6 +1367,32 @@ function assertAcknowledgedTotal(value) {
1319
1367
  function optionalDecimalString(v) {
1320
1368
  return v == null ? void 0 : String(v);
1321
1369
  }
1370
+ function nullableDecimalString(raw, fallback, key) {
1371
+ for (const src of [raw, fallback]) {
1372
+ if (Object.prototype.hasOwnProperty.call(src, key)) {
1373
+ const v = src[key];
1374
+ if (v === null) return null;
1375
+ if (v !== void 0) return String(v);
1376
+ }
1377
+ }
1378
+ return void 0;
1379
+ }
1380
+ function toMinPurchaseWarning(v) {
1381
+ if (!v || typeof v !== "object" || Array.isArray(v)) return void 0;
1382
+ const r = v;
1383
+ return {
1384
+ code: String(r["code"] ?? ""),
1385
+ minUsd: r["min_usd"] == null ? "" : String(r["min_usd"]),
1386
+ enforcedFrom: r["enforced_from"] == null ? "" : String(r["enforced_from"]),
1387
+ ...typeof r["message"] === "string" && r["message"] ? { message: r["message"] } : {},
1388
+ ...typeof r["enforced"] === "boolean" ? { enforced: r["enforced"] } : {},
1389
+ raw: r
1390
+ };
1391
+ }
1392
+ function minPurchaseWarningField(raw) {
1393
+ const w = toMinPurchaseWarning(raw["min_purchase_warning"]);
1394
+ return w === void 0 ? {} : { minPurchaseWarning: w };
1395
+ }
1322
1396
  function toQuoteBreakdown(row) {
1323
1397
  const r = row && typeof row === "object" ? row : {};
1324
1398
  const nullable = (v) => v == null ? null : String(v);
@@ -1337,16 +1411,22 @@ function toQuoteBreakdown(row) {
1337
1411
  raw: r
1338
1412
  };
1339
1413
  }
1340
- function toUnacknowledgedOutcome(row) {
1414
+ function toUnacknowledgedOutcome(row, quote = {}) {
1341
1415
  if (!row || typeof row !== "object") return null;
1342
1416
  const r = row;
1343
1417
  return {
1344
1418
  chargeTotalUsd: String(r["charge_total_usd"] ?? ""),
1345
1419
  processingFeeUsd: String(r["processing_fee_usd"] ?? ""),
1346
1420
  coins: String(r["coins"] ?? ""),
1347
- feeTakenFrom: String(r["fee_taken_from"] ?? "coins")
1421
+ feeTakenFrom: String(r["fee_taken_from"] ?? unacknowledgedFeeFallback(r, quote)),
1422
+ ...Object.prototype.hasOwnProperty.call(r, "partner_fee_usd") ? { partnerFeeUsd: r["partner_fee_usd"] == null ? null : String(r["partner_fee_usd"]) } : {}
1348
1423
  };
1349
1424
  }
1425
+ function unacknowledgedFeeFallback(row, quote) {
1426
+ const breakdown = quote["breakdown"];
1427
+ const hasPartnerFee = row["partner_fee_usd"] != null || quote["partner_fee_usd"] != null || !!breakdown && typeof breakdown === "object" && breakdown["partner_fee_usd"] != null;
1428
+ return hasPartnerFee ? "partner" : "coins";
1429
+ }
1350
1430
  function toCurrencyPurchaseQuote(raw) {
1351
1431
  const breakdown = toQuoteBreakdown(raw["breakdown"]);
1352
1432
  return {
@@ -1358,10 +1438,22 @@ function toCurrencyPurchaseQuote(raw) {
1358
1438
  coins: String(raw["coins"] ?? breakdown.coins),
1359
1439
  currencyName: String(raw["currency_name"] ?? breakdown.currencyName),
1360
1440
  breakdown,
1361
- ifUnacknowledged: toUnacknowledgedOutcome(raw["if_unacknowledged"]),
1441
+ ...raw["fee_taken_from"] != null ? { feeTakenFrom: String(raw["fee_taken_from"]) } : {},
1442
+ ifUnacknowledged: toUnacknowledgedOutcome(raw["if_unacknowledged"], raw),
1443
+ ...pricingFields(raw, breakdown.raw),
1362
1444
  raw
1363
1445
  };
1364
1446
  }
1447
+ function pricingFields(raw, fallback = {}) {
1448
+ const out = {};
1449
+ const partnerFee = nullableDecimalString(raw, fallback, "partner_fee_usd");
1450
+ if (partnerFee !== void 0) out.partnerFeeUsd = partnerFee;
1451
+ const intlFee = nullableDecimalString(raw, fallback, "international_card_fee_usd");
1452
+ if (intlFee !== void 0) out.internationalCardFeeUsd = intlFee;
1453
+ const warning = toMinPurchaseWarning(raw["min_purchase_warning"] ?? fallback["min_purchase_warning"]);
1454
+ if (warning !== void 0) out.minPurchaseWarning = warning;
1455
+ return out;
1456
+ }
1365
1457
  function invalidInput(label, value, why) {
1366
1458
  return new InvoError({
1367
1459
  message: `${label} ${why} (got ${JSON.stringify(value)}).`,
@@ -1775,6 +1867,7 @@ var PlatformCommerceServer = class {
1775
1867
  expiresAt: typeof expiresAtRaw === "number" ? expiresAtRaw : void 0,
1776
1868
  amountUsd: raw["amount_usd"] ?? null,
1777
1869
  idempotentReplay: raw["idempotent_replay"] === true,
1870
+ ...minPurchaseWarningField(raw),
1778
1871
  raw
1779
1872
  };
1780
1873
  }
@@ -1853,6 +1946,9 @@ var PlatformCommerceServer = class {
1853
1946
  ...raw["refunded_total_usd"] != null ? { refundedTotalUsd: String(raw["refunded_total_usd"]) } : {},
1854
1947
  ...raw["charge_total_usd"] != null ? { chargeTotalUsd: String(raw["charge_total_usd"]) } : {},
1855
1948
  ...raw["remaining_usd"] != null ? { remainingUsd: String(raw["remaining_usd"]) } : {},
1949
+ // 2026-09 pricing, card leg only: the card fee stays charged to the partner on a refund.
1950
+ ...raw["card_fee_charged_to_partner_usd"] != null ? { cardFeeChargedToPartnerUsd: String(raw["card_fee_charged_to_partner_usd"]) } : {},
1951
+ ...raw["partner_debited_usd"] != null ? { partnerDebitedUsd: String(raw["partner_debited_usd"]) } : {},
1856
1952
  raw
1857
1953
  };
1858
1954
  }
@@ -3054,6 +3150,7 @@ var InvoServer = class {
3054
3150
  // the purchase status later does not have to parse a URL itself.
3055
3151
  sessionToken: sessionTokenFromCreateCheckout(raw, checkoutUrl),
3056
3152
  warnings: toCheckoutWarnings(raw["warnings"]),
3153
+ ...minPurchaseWarningField(raw),
3057
3154
  raw
3058
3155
  };
3059
3156
  }
@@ -3064,17 +3161,27 @@ var InvoServer = class {
3064
3161
  * - rail "game": returns status "pending_payment" + paymentUrl (redirect the browser).
3065
3162
  * - rail "steam": NOT a browser flow — the backend returns WRONG_RAIL_ENDPOINT.
3066
3163
  *
3067
- * INVO's card fee (3.5% + $0.30 on Open, 5% + $0.30 on Merchant of Record, never less than the card cost). Two shapes, chosen by
3068
- * what you send:
3164
+ * INVO's card fee (4.5% + $0.30 on Open, 5.5% + $0.50 on Merchant of Record, plus 1.5% of
3165
+ * the listed price (before tax) on a card issued outside the US) is charged to you, the partner. The player
3166
+ * pays the listed price (plus any tax) and receives the listed coins. Card purchases only;
3167
+ * purchases through a third-party storefront or payment rail are unaffected. Two shapes,
3168
+ * chosen by what you send:
3069
3169
  * - with `acknowledgedTotalUsd` (the `totalUsd` from {@link quoteCurrencyPurchase}): the
3070
- * card is charged that total and the coins are priced off `usdAmount`. A total that no
3071
- * longer matches throws `409 QUOTE_STALE` (`err.isQuoteStale`); nothing was charged.
3072
- * - without it: the card is charged exactly `usdAmount`, never more, and the fee comes out
3073
- * of the coins. An amount too small to carry the fee throws `400 AMOUNT_BELOW_FEE`
3074
- * (`err.isAmountBelowFee`); nothing was charged.
3170
+ * card is never charged more than that total, and the coins are priced off `usdAmount`.
3171
+ * An older, higher fee-inclusive total is accepted and the true, lower total charged. A
3172
+ * total below what INVO would charge now throws `409 QUOTE_STALE` (`err.isQuoteStale`);
3173
+ * nothing was charged.
3174
+ * - without it: the card is charged exactly `usdAmount`, never more.
3075
3175
  *
3076
- * A `success` result reports `processingFeeUsd`, `feeTakenFrom`, `coinsCredited` and
3077
- * `chargeTotalUsd`.
3176
+ * From 2026-10-27 a card purchase under INVO's minimum card purchase ($2.99) throws
3177
+ * `400 BELOW_CARD_MINIMUM` (`err.isBelowCardMinimum`, `err.minUsd`, `err.enforcedFrom`);
3178
+ * until then it is accepted with `minPurchaseWarning`. `AMOUNT_BELOW_FEE` is no longer
3179
+ * returned.
3180
+ *
3181
+ * A `success` result reports `processingFeeUsd` (`"0.00"`), `feeTakenFrom` (`"partner"`),
3182
+ * `partnerFeeUsd`, `internationalCardFeeUsd` (`"0.00"` on a US card or one whose country
3183
+ * is unknown; both `null` if the fee could not be booked yet, which INVO does shortly after),
3184
+ * `coinsCredited` and `chargeTotalUsd`, each as INVO sent it.
3078
3185
  */
3079
3186
  async purchaseCurrency(input, opts) {
3080
3187
  if (typeof input.playerEmail !== "string" || !input.playerEmail.trim()) {
@@ -3110,6 +3217,8 @@ var InvoServer = class {
3110
3217
  if (input.playerName) body["player_name"] = input.playerName;
3111
3218
  if (input.playerPhone) body["player_phone"] = input.playerPhone;
3112
3219
  if (input.metadata) body["metadata"] = input.metadata;
3220
+ if (input.country) body["country"] = input.country;
3221
+ if (input.subdivision) body["subdivision"] = input.subdivision;
3113
3222
  const raw = await this.http.post(
3114
3223
  "/api/currency-purchases/purchase-currency",
3115
3224
  body,
@@ -3129,6 +3238,7 @@ var InvoServer = class {
3129
3238
  feeTakenFrom: optionalDecimalString(raw["fee_taken_from"]),
3130
3239
  coinsCredited: optionalDecimalString(raw["coins_credited"]),
3131
3240
  chargeTotalUsd: optionalDecimalString(raw["charge_total_usd"]),
3241
+ ...pricingFields(raw),
3132
3242
  ...receiptFields(raw),
3133
3243
  raw
3134
3244
  };
@@ -3138,14 +3248,17 @@ var InvoServer = class {
3138
3248
  * creates nothing, so it is safe to call on every price render (`POST
3139
3249
  * /api/currency-purchases/quote`, authenticated by your game secret like the purchase).
3140
3250
  *
3141
- * INVO's card fee on a coin purchase is 3.5% + $0.30 of the price on the Open tier (5% + $0.30 on Merchant of Record), never less than the
3142
- * card cost. `totalUsd` is the price plus that fee (plus any tax, when you pass `country`):
3143
- * $10.00 quotes a $10.65 total. Show the player `totalUsd`, then send the same figure back
3144
- * as `acknowledgedTotalUsd` on {@link purchaseCurrency}; the card is charged exactly that
3145
- * and the player gets the coins for the full price. `ifUnacknowledged` shows the other
3146
- * outcome: the card charged exactly `usdAmount` and the fee taken out of the coins ($10.00
3147
- * gives 93.70 coins at the default 10 per USD), or `null` when the amount cannot carry the
3148
- * fee.
3251
+ * The player pays the listed price plus any tax (when you pass `country`) and receives the
3252
+ * listed coins: `totalUsd` carries no card fee, and `processingFeeUsd` is `"0.00"`. INVO's
3253
+ * card fee (4.5% + $0.30 on Open, 5.5% + $0.50 on Merchant of Record) is charged to you;
3254
+ * `partnerFeeUsd` carries it when INVO sends it. $10.00 quotes a $10.00 total, 100.00 coins
3255
+ * at the default 10 per USD, and a $0.75 partner fee on Open. Show the player `totalUsd`,
3256
+ * then send the same figure back as `acknowledgedTotalUsd` on {@link purchaseCurrency}; the
3257
+ * card is never charged more than that. `ifUnacknowledged` shows the purchase without the
3258
+ * acknowledgement (the card charged exactly `usdAmount`), or `null` when INVO sends none.
3259
+ * `minPurchaseWarning` is set while an amount under INVO's minimum card purchase is still
3260
+ * accepted. Card purchases only; purchases through a third-party storefront or payment
3261
+ * rail are unaffected.
3149
3262
  *
3150
3263
  * Refusals: `400 INVALID_INPUT` (amount missing, not above zero, or above INVO's card
3151
3264
  * maximum), `400 CURRENCY_NOT_CONFIGURED`, `503 RATE_UNAVAILABLE`.
package/dist/server.d.cts CHANGED
@@ -1,12 +1,12 @@
1
- import { I as InvoError, H as Http, x as AuthHeader, y as CardSetupSessionInput, g as CallOptions, z as CardSetupSessionResult, F as CardSetupInput, G as CardSetupResult, J as CardSetupConfirmInput, K as CardSetupConfirmResult, N as PlayerCardsResult, O as PlatformPurchaseInput, Q as PlatformPurchaseResult, S as PlatformOrderStatusResult, T as PlatformRefundInput, U as PlatformRefundResult, X as CreateSubscriptionInput, Y as SubscriptionResult, Z as GetSubscriptionOptions, _ as GetSubscriptionResult, $ as ListSubscriptionsOptions, a0 as SubscriptionListResult, a1 as CancelSubscriptionOptions, a2 as CancelResult, a3 as ChangeAmountResult, a4 as SetPaymentMethodInput, a5 as SetPaymentMethodResult, a6 as RefundSubscriptionInput, a7 as RefundResult, a8 as SteamSubscriptionInitInput, a9 as SteamInitResult, aa as SteamFinalizeSubscriptionResult, ab as SandboxClockResult, ac as SandboxFailureOutcome, ad as SandboxForceFailureOptions, ae as SandboxForceAuthChallengeOptions, af as ServerConfig, ag as PlayerToken, ah as InitiateSendInput, ai as InitiateResult, aj as InitiateTransferInput, ak as CreateCheckoutInput, al as CreateCheckoutResult, am as PurchaseInput, an as PurchaseResult, ao as CurrencyPurchaseQuoteInput, ap as CurrencyPurchaseQuote, aq as ConfirmPaymentResult, ar as OrderDetailsResult, as as SteamPacksQuery, at as SteamPacksResult, au as SteamInitPurchaseInput, av as SteamInitPurchaseResult, aw as SteamFinalizeInput, ax as SteamFinalizeResult, ay as PurchaseItemInput, az as PurchaseItemResult, aA as ItemHistoryQuery, aB as ItemHistoryResult, aC as ItemOrderQuery, aD as PlayerBalanceQuery, aE as PlayerBalanceResult, aF as InboundPendingQuery, aG as InboundPendingResult, aH as LinkedIdentitiesQuery, aI as LinkedIdentitiesResult, aJ as SmsVerifyResult, aK as ClaimTransferInput, aL as ClaimResult, aM as ClaimCurrencyInput, aN as TransactionStatusResult, aO as GuardianApprovalStatusResult, aP as ServerDestinationsQuery, k as DestinationsResult, aQ as PhoneShareContact, aR as PhoneShareInitiateResult, aS as PhoneShareApproveInput, aT as PhoneShareApproveResult, aU as PhoneShareStatusResult, aV as BeginDeviceApprovalInput, aW as DeviceApprovalGrant, aX as PollDeviceApprovalInput, aY as DeviceApprovalPollResult, aZ as ConfirmDeviceEnrollmentInput, a_ as ConfirmDeviceEnrollmentResult, a$ as ApproveWithDeviceCodeInput, b0 as DeviceApprovalSettleResult, b1 as CompleteDeviceApprovalInput, b2 as CompleteDeviceApprovalResult } from './types-CjJARoLk.cjs';
2
- export { b3 as CardSetupStatus, b4 as CheckoutWarning, b5 as CurrencyBalance, b6 as CurrencyPurchaseQuoteBreakdown, p as DestinationGame, b7 as DeviceApprovalChannel, b8 as DeviceApprovalEnrollment, b9 as DeviceApprovalFlow, ba as DeviceApprovalPollStatus, bb as DeviceEnrollmentDecision, bc as DeviceEnrollmentRespond, bd as FeeTakenFrom, be as FirstCharge, bf as FirstChargeStatus, bg as FundingSource, bh as InboundPendingItem, q as InvoErrorInfo, r as InvoHooks, s as InvoRequestInfo, t as InvoResponseInfo, bi as LinkedIdentityEmail, bj as PlatformPurchaseStatus, w as Rail, bk as RefundInitiation, bl as RefundPendingApproval, bm as RefundProcessingFeeBasis, bn as RefundReceipt, bo as RefundRevenueShareAttribution, bp as RefundWarning, bq as SandboxClockState, br as SavedCard, bs as SteamPack, bt as SteamUserSession, bu as Subscription, bv as SubscriptionBaseInput, bw as SubscriptionConsent, bx as SubscriptionConsentInput, by as SubscriptionFundingRail, bz as SubscriptionInterval, bA as SubscriptionRevenueShare, bB as SubscriptionRevenueShareInput, bC as SubscriptionStatus, bD as UnacknowledgedPurchaseOutcome, V as VerificationMethod, bE as isRefundPendingApproval } from './types-CjJARoLk.cjs';
1
+ import { I as InvoError, H as Http, x as AuthHeader, y as CardSetupSessionInput, g as CallOptions, z as CardSetupSessionResult, F as CardSetupInput, G as CardSetupResult, J as CardSetupConfirmInput, K as CardSetupConfirmResult, N as PlayerCardsResult, O as PlatformPurchaseInput, Q as PlatformPurchaseResult, S as PlatformOrderStatusResult, T as PlatformRefundInput, U as PlatformRefundResult, X as CreateSubscriptionInput, Y as SubscriptionResult, Z as GetSubscriptionOptions, _ as GetSubscriptionResult, $ as ListSubscriptionsOptions, a0 as SubscriptionListResult, a1 as CancelSubscriptionOptions, a2 as CancelResult, a3 as ChangeAmountResult, a4 as SetPaymentMethodInput, a5 as SetPaymentMethodResult, a6 as RefundSubscriptionInput, a7 as RefundResult, a8 as SteamSubscriptionInitInput, a9 as SteamInitResult, aa as SteamFinalizeSubscriptionResult, ab as SandboxClockResult, ac as SandboxFailureOutcome, ad as SandboxForceFailureOptions, ae as SandboxForceAuthChallengeOptions, af as ServerConfig, ag as PlayerToken, ah as InitiateSendInput, ai as InitiateResult, aj as InitiateTransferInput, ak as CreateCheckoutInput, al as CreateCheckoutResult, am as PurchaseInput, an as PurchaseResult, ao as CurrencyPurchaseQuoteInput, ap as CurrencyPurchaseQuote, aq as ConfirmPaymentResult, ar as OrderDetailsResult, as as SteamPacksQuery, at as SteamPacksResult, au as SteamInitPurchaseInput, av as SteamInitPurchaseResult, aw as SteamFinalizeInput, ax as SteamFinalizeResult, ay as PurchaseItemInput, az as PurchaseItemResult, aA as ItemHistoryQuery, aB as ItemHistoryResult, aC as ItemOrderQuery, aD as PlayerBalanceQuery, aE as PlayerBalanceResult, aF as InboundPendingQuery, aG as InboundPendingResult, aH as LinkedIdentitiesQuery, aI as LinkedIdentitiesResult, aJ as SmsVerifyResult, aK as ClaimTransferInput, aL as ClaimResult, aM as ClaimCurrencyInput, aN as TransactionStatusResult, aO as GuardianApprovalStatusResult, aP as ServerDestinationsQuery, k as DestinationsResult, aQ as PhoneShareContact, aR as PhoneShareInitiateResult, aS as PhoneShareApproveInput, aT as PhoneShareApproveResult, aU as PhoneShareStatusResult, aV as BeginDeviceApprovalInput, aW as DeviceApprovalGrant, aX as PollDeviceApprovalInput, aY as DeviceApprovalPollResult, aZ as ConfirmDeviceEnrollmentInput, a_ as ConfirmDeviceEnrollmentResult, a$ as ApproveWithDeviceCodeInput, b0 as DeviceApprovalSettleResult, b1 as CompleteDeviceApprovalInput, b2 as CompleteDeviceApprovalResult } from './types-BnnVi5ws.cjs';
2
+ export { b3 as CardSetupStatus, b4 as CheckoutWarning, b5 as CurrencyBalance, b6 as CurrencyPurchaseQuoteBreakdown, p as DestinationGame, b7 as DeviceApprovalChannel, b8 as DeviceApprovalEnrollment, b9 as DeviceApprovalFlow, ba as DeviceApprovalPollStatus, bb as DeviceEnrollmentDecision, bc as DeviceEnrollmentRespond, bd as FeeTakenFrom, be as FirstCharge, bf as FirstChargeStatus, bg as FundingSource, bh as InboundPendingItem, q as InvoErrorInfo, r as InvoHooks, s as InvoRequestInfo, t as InvoResponseInfo, bi as LinkedIdentityEmail, bj as MinPurchaseWarning, bk as PlatformPurchaseStatus, w as Rail, bl as RefundInitiation, bm as RefundPendingApproval, bn as RefundProcessingFeeBasis, bo as RefundReceipt, bp as RefundRevenueShareAttribution, bq as RefundWarning, br as SandboxClockState, bs as SavedCard, bt as SteamPack, bu as SteamUserSession, bv as Subscription, bw as SubscriptionBaseInput, bx as SubscriptionConsent, by as SubscriptionConsentInput, bz as SubscriptionFundingRail, bA as SubscriptionInterval, bB as SubscriptionRevenueShare, bC as SubscriptionRevenueShareInput, bD as SubscriptionStatus, bE as UnacknowledgedPurchaseOutcome, V as VerificationMethod, bF as isRefundPendingApproval } from './types-BnnVi5ws.cjs';
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.16.1";
9
+ declare const SDK_VERSION = "3.17.0";
10
10
 
11
11
  interface VerifyWebhookOptions {
12
12
  /** Max age of the signed timestamp, in seconds. Default 300 (5 min). */
@@ -65,6 +65,23 @@ interface PurchaseCompletedData {
65
65
  receipt_number?: string;
66
66
  /** Merchant of Record only: link to the printable receipt page. Anyone with it can read it. */
67
67
  receipt_url?: string;
68
+ /**
69
+ * Additive (2026-09 pricing). INVO's card fee charged to you for this purchase, USD decimal
70
+ * string: 4.5% + $0.30 on Open, 5.5% + $0.50 on Merchant of Record. The buyer paid the listed
71
+ * price (plus any tax) and received the listed coins; the fee nets against your earnings.
72
+ * Card purchases only; absent on purchases through a third-party storefront or payment rail,
73
+ * on an order charged before the 2026-09 pricing, and from backends that do not send it.
74
+ * `null` when the fee could not be booked when the purchase completed (the purchase itself
75
+ * succeeded; INVO books the fee shortly after).
76
+ */
77
+ partner_fee_usd?: string | null;
78
+ /**
79
+ * Additive (2026-09 pricing). The international card fee charged to you, USD decimal string:
80
+ * 1.5% of the listed price (before tax) on a card issued outside the US, `"0.00"` otherwise
81
+ * (a card whose country is unknown counts as domestic). Separate from `partner_fee_usd`.
82
+ * Card purchases only; absent and `null` on the same terms as `partner_fee_usd`.
83
+ */
84
+ international_card_fee_usd?: string | null;
68
85
  [key: string]: unknown;
69
86
  }
70
87
  interface PurchaseEventData {
@@ -74,6 +91,57 @@ interface PurchaseEventData {
74
91
  identity_id?: string;
75
92
  /** Present on purchase.disputed, e.g. "lost". */
76
93
  dispute_status?: string;
94
+ /**
95
+ * Additive (2026-09 pricing), on a LOST purchase.disputed for a Platform Commerce card sale
96
+ * or a subscription charge (`order_type` `"platform_commerce"` or `"subscription_renewal"`).
97
+ * `true` when INVO's chargeback guarantee covers this dispute: a fraud chargeback on a card
98
+ * sale, which INVO absorbs, so your share is not reversed or held and no dispute fee is passed
99
+ * to you. `false` for any other dispute, handled as before. Never sent on a coin purchase
100
+ * dispute (a lost coin chargeback takes back the player's coins, not your share, so there is
101
+ * nothing to cover), nor on an opened or won event. Do not read absence as either value.
102
+ */
103
+ guarantee_covered?: boolean;
104
+ /**
105
+ * Additive, on a lost purchase.disputed for an order that sold no coins: `"platform_commerce"`
106
+ * or `"subscription_renewal"`. Absent on a coin purchase dispute.
107
+ */
108
+ order_type?: string;
109
+ /**
110
+ * Additive, on a lost Platform Commerce or subscription purchase.disputed: your share of the
111
+ * sale reversed, USD decimal string (`"0.00"` when the chargeback guarantee covered it).
112
+ */
113
+ developer_revenue_reversed_usd?: string | null;
114
+ /**
115
+ * Additive (2026-09-27), on a lost subscription purchase.disputed: the card processor fee
116
+ * charged to you, the same figure a refund of that period charges, USD decimal string.
117
+ * `"0.00"` when the chargeback guarantee covered it and on a charge made before the 2026-09
118
+ * pricing. `null` where it does not apply (for example a Platform Commerce dispute, where the
119
+ * card fee simply stays charged to you as on a refund). Absent on coin purchase disputes.
120
+ */
121
+ processing_fee_usd?: string | null;
122
+ /** On a lost subscription purchase.disputed: the subscription and period it concerns. */
123
+ subscription_id?: string | null;
124
+ period_seq?: number | null;
125
+ /**
126
+ * Card-only ids on purchase.disputed. `null` on a storefront chargeback (for example a
127
+ * Steam chargeback, which has no payment intent, charge or dispute id).
128
+ */
129
+ payment_intent_id?: string | null;
130
+ charge_id?: string | null;
131
+ dispute_id?: string | null;
132
+ /**
133
+ * The rail the purchase was paid on, where the event carries it: `"steam"` on a Steam
134
+ * `purchase.refunded` or `purchase.disputed`.
135
+ */
136
+ rail?: string;
137
+ /** The Steam transaction id, on a Steam `purchase.refunded` or `purchase.disputed`. */
138
+ steam_transid?: string;
139
+ /** On purchase.refunded: `false` for a partial refund (a Steam partial refund included). */
140
+ fully_refunded?: boolean;
141
+ /** Coins taken back by this event, or `null` when the player has no balance row. */
142
+ currency_debited?: string | null;
143
+ /** The player's balance after this event. Never below zero. */
144
+ new_balance?: string | null;
77
145
  /**
78
146
  * Merchant of Record accounts only (on `purchase.refunded`, card refunds): the REFUND receipt INVO issued to the
79
147
  * buyer. Absent on Open accounts, and while a refund is still pending.
@@ -120,7 +188,21 @@ interface PlatformCommercePurchasedData {
120
188
  new_balance?: string;
121
189
  /** Card leg only (the USD charged). */
122
190
  total_price_usd?: string;
191
+ /**
192
+ * `{ total_paid, platform_fee, developer_revenue, ... }`. `platform_fee` is INVO's whole fee
193
+ * and INCLUDES the international card fee; `platform_fee + developer_revenue = total_paid`.
194
+ * Since the 2026-09 pricing it also carries `international_card_fee_usd` (the part of
195
+ * `platform_fee` that is the international card fee, `"0.00"` on a US card and on the
196
+ * balance leg), so the card rate part is `platform_fee - international_card_fee_usd`.
197
+ */
123
198
  fee_breakdown?: Record<string, unknown>;
199
+ /**
200
+ * Additive (2026-09 pricing). The international card fee on this sale, USD decimal string:
201
+ * 1.5% of the listed price (before tax) on a card issued outside the US, `"0.00"` otherwise
202
+ * and on the balance leg. Already INCLUDED in `fee_breakdown.platform_fee`; do not add it
203
+ * again.
204
+ */
205
+ international_card_fee_usd?: string;
124
206
  /**
125
207
  * Merchant of Record accounts only (card sales): the receipt INVO issued to the buyer.
126
208
  * Absent on Open accounts and storefront rails.
@@ -130,8 +212,9 @@ interface PlatformCommercePurchasedData {
130
212
  receipt_url?: string;
131
213
  [key: string]: unknown;
132
214
  }
133
- /** `platform_commerce.refunded` — a Platform Commerce purchase was refunded. INVO keeps
134
- * its fee (`fee_retained: true`); the customer is made whole minus that fee. */
215
+ /** `platform_commerce.refunded`: a Platform Commerce purchase was refunded. INVO's fee is
216
+ * not returned (`fee_retained: true`). On a card refund the fee stays charged to you
217
+ * (`card_fee_charged_to_partner_usd`, `partner_debited_usd`). */
135
218
  interface PlatformCommerceRefundedData {
136
219
  order_id: string | number;
137
220
  /** "balance" | "card". */
@@ -151,6 +234,17 @@ interface PlatformCommerceRefundedData {
151
234
  receipt_number?: string;
152
235
  /** Merchant of Record only: link to the printable refund receipt page. */
153
236
  receipt_url?: string;
237
+ /**
238
+ * Additive (2026-09 pricing), card refunds only: the part of INVO's card fee on this refund
239
+ * that stays charged to you, USD decimal string. The card fee is not returned on a refund.
240
+ */
241
+ card_fee_charged_to_partner_usd?: string;
242
+ /**
243
+ * Additive (2026-09 pricing), card refunds only: everything this refund takes from your
244
+ * earnings, USD decimal string: your share of the sale reversed plus
245
+ * `card_fee_charged_to_partner_usd`.
246
+ */
247
+ partner_debited_usd?: string;
154
248
  [key: string]: unknown;
155
249
  }
156
250
  interface TransferEventData {
@@ -227,9 +321,12 @@ interface SubscriptionRenewalFunding {
227
321
  [key: string]: unknown;
228
322
  }
229
323
  /**
230
- * The fee split for one renewal. On the card rail INVO's fee is its percentage plus $0.30 on
231
- * the full price. On Steam, `basis` is `"steam_net"` and `total_usd` is
232
- * what the coins are worth after Valve's share and VAT, NOT the price (the price is the
324
+ * The fee split for one renewal. On the card rail INVO's fee (`invo_fee_usd`) is 4.5% + $0.30
325
+ * on Open (5.5% + $0.50 on Merchant of Record) of the listed price (before tax). The 1.5%
326
+ * international card fee on a card issued outside the US is NOT inside `invo_fee_usd`: it is
327
+ * reported separately as `international_card_fee_usd` (also `pass_through_fees_usd`) and charged
328
+ * to you on top. Read the figures; do not recompute them. On Steam, `basis` is
329
+ * `"steam_net"` and `total_usd` is what the coins are worth after Valve's share and VAT, NOT the price (the price is the
233
330
  * event's top-level `amount_usd`).
234
331
  */
235
332
  interface SubscriptionRenewalSplit {
@@ -241,6 +338,23 @@ interface SubscriptionRenewalSplit {
241
338
  invo_fee_coins: string;
242
339
  partner_revenue_coins: string;
243
340
  invo_fee_percent: string;
341
+ /**
342
+ * The international card fee charged to you on this renewal, USD decimal string, billed on
343
+ * top of `invo_fee_usd`: `partner_revenue_usd` stays the gross figure and does not include
344
+ * it. Since the 2026-09 pricing it is the flat international card fee, and
345
+ * `international_card_fee_usd` carries the same figure under its own name. They are ONE
346
+ * charge reported twice: never add the two together. `"0.00"` on a US card.
347
+ */
348
+ pass_through_fees_usd?: string;
349
+ /** `"recorded"`, `"none"`, `"pending"` or `"not_applicable"` (no card charge). Treat unknown values as informational. */
350
+ pass_through_status?: string;
351
+ /**
352
+ * Additive (2026-09 pricing). The international card fee on this renewal: 1.5% of the listed
353
+ * price (before tax) on a card issued outside the US, `"0.00"` otherwise, while pending, and
354
+ * on a charge opened before the 2026-09 pricing. The same figure as
355
+ * `pass_through_fees_usd`; do not add them.
356
+ */
357
+ international_card_fee_usd?: string;
244
358
  [key: string]: unknown;
245
359
  }
246
360
  /** Revenue-share attribution on a renewal. INVO pays nothing (`settled_by_invo: false`). */
@@ -1108,17 +1222,27 @@ declare class InvoServer {
1108
1222
  * - rail "game": returns status "pending_payment" + paymentUrl (redirect the browser).
1109
1223
  * - rail "steam": NOT a browser flow — the backend returns WRONG_RAIL_ENDPOINT.
1110
1224
  *
1111
- * INVO's card fee (3.5% + $0.30 on Open, 5% + $0.30 on Merchant of Record, never less than the card cost). Two shapes, chosen by
1112
- * what you send:
1225
+ * INVO's card fee (4.5% + $0.30 on Open, 5.5% + $0.50 on Merchant of Record, plus 1.5% of
1226
+ * the listed price (before tax) on a card issued outside the US) is charged to you, the partner. The player
1227
+ * pays the listed price (plus any tax) and receives the listed coins. Card purchases only;
1228
+ * purchases through a third-party storefront or payment rail are unaffected. Two shapes,
1229
+ * chosen by what you send:
1113
1230
  * - with `acknowledgedTotalUsd` (the `totalUsd` from {@link quoteCurrencyPurchase}): the
1114
- * card is charged that total and the coins are priced off `usdAmount`. A total that no
1115
- * longer matches throws `409 QUOTE_STALE` (`err.isQuoteStale`); nothing was charged.
1116
- * - without it: the card is charged exactly `usdAmount`, never more, and the fee comes out
1117
- * of the coins. An amount too small to carry the fee throws `400 AMOUNT_BELOW_FEE`
1118
- * (`err.isAmountBelowFee`); nothing was charged.
1231
+ * card is never charged more than that total, and the coins are priced off `usdAmount`.
1232
+ * An older, higher fee-inclusive total is accepted and the true, lower total charged. A
1233
+ * total below what INVO would charge now throws `409 QUOTE_STALE` (`err.isQuoteStale`);
1234
+ * nothing was charged.
1235
+ * - without it: the card is charged exactly `usdAmount`, never more.
1236
+ *
1237
+ * From 2026-10-27 a card purchase under INVO's minimum card purchase ($2.99) throws
1238
+ * `400 BELOW_CARD_MINIMUM` (`err.isBelowCardMinimum`, `err.minUsd`, `err.enforcedFrom`);
1239
+ * until then it is accepted with `minPurchaseWarning`. `AMOUNT_BELOW_FEE` is no longer
1240
+ * returned.
1119
1241
  *
1120
- * A `success` result reports `processingFeeUsd`, `feeTakenFrom`, `coinsCredited` and
1121
- * `chargeTotalUsd`.
1242
+ * A `success` result reports `processingFeeUsd` (`"0.00"`), `feeTakenFrom` (`"partner"`),
1243
+ * `partnerFeeUsd`, `internationalCardFeeUsd` (`"0.00"` on a US card or one whose country
1244
+ * is unknown; both `null` if the fee could not be booked yet, which INVO does shortly after),
1245
+ * `coinsCredited` and `chargeTotalUsd`, each as INVO sent it.
1122
1246
  */
1123
1247
  purchaseCurrency(input: PurchaseInput, opts?: CallOptions): Promise<PurchaseResult>;
1124
1248
  /**
@@ -1126,14 +1250,17 @@ declare class InvoServer {
1126
1250
  * creates nothing, so it is safe to call on every price render (`POST
1127
1251
  * /api/currency-purchases/quote`, authenticated by your game secret like the purchase).
1128
1252
  *
1129
- * INVO's card fee on a coin purchase is 3.5% + $0.30 of the price on the Open tier (5% + $0.30 on Merchant of Record), never less than the
1130
- * card cost. `totalUsd` is the price plus that fee (plus any tax, when you pass `country`):
1131
- * $10.00 quotes a $10.65 total. Show the player `totalUsd`, then send the same figure back
1132
- * as `acknowledgedTotalUsd` on {@link purchaseCurrency}; the card is charged exactly that
1133
- * and the player gets the coins for the full price. `ifUnacknowledged` shows the other
1134
- * outcome: the card charged exactly `usdAmount` and the fee taken out of the coins ($10.00
1135
- * gives 93.70 coins at the default 10 per USD), or `null` when the amount cannot carry the
1136
- * fee.
1253
+ * The player pays the listed price plus any tax (when you pass `country`) and receives the
1254
+ * listed coins: `totalUsd` carries no card fee, and `processingFeeUsd` is `"0.00"`. INVO's
1255
+ * card fee (4.5% + $0.30 on Open, 5.5% + $0.50 on Merchant of Record) is charged to you;
1256
+ * `partnerFeeUsd` carries it when INVO sends it. $10.00 quotes a $10.00 total, 100.00 coins
1257
+ * at the default 10 per USD, and a $0.75 partner fee on Open. Show the player `totalUsd`,
1258
+ * then send the same figure back as `acknowledgedTotalUsd` on {@link purchaseCurrency}; the
1259
+ * card is never charged more than that. `ifUnacknowledged` shows the purchase without the
1260
+ * acknowledgement (the card charged exactly `usdAmount`), or `null` when INVO sends none.
1261
+ * `minPurchaseWarning` is set while an amount under INVO's minimum card purchase is still
1262
+ * accepted. Card purchases only; purchases through a third-party storefront or payment
1263
+ * rail are unaffected.
1137
1264
  *
1138
1265
  * Refusals: `400 INVALID_INPUT` (amount missing, not above zero, or above INVO's card
1139
1266
  * maximum), `400 CURRENCY_NOT_CONFIGURED`, `503 RATE_UNAVAILABLE`.