@invonetwork/web-sdk 3.17.0 → 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/CHANGELOG.md +18 -0
- package/README.md +59 -35
- package/dist/{chunk-JGDNPNQX.js → chunk-YW2PYARQ.js} +60 -12
- package/dist/index.cjs +58 -10
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +2 -2
- package/dist/server.cjs +143 -30
- package/dist/server.d.cts +131 -24
- package/dist/server.d.ts +131 -24
- package/dist/server.js +87 -22
- package/dist/{types-CjJARoLk.d.cts → types-BnnVi5ws.d.cts} +210 -48
- package/dist/{types-CjJARoLk.d.ts → types-BnnVi5ws.d.ts} +210 -48
- package/package.json +1 -1
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
|
-
/**
|
|
383
|
-
*
|
|
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
|
|
402
|
-
* small to carry INVO's card fee (`AMOUNT_BELOW_FEE`, 400). Nothing was charged.
|
|
403
|
-
*
|
|
404
|
-
*
|
|
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`
|
|
411
|
-
*
|
|
412
|
-
*
|
|
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
|
|
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
|
|
@@ -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"] ??
|
|
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
|
-
|
|
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 (
|
|
3068
|
-
*
|
|
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`.
|
|
3071
|
-
*
|
|
3072
|
-
*
|
|
3073
|
-
*
|
|
3074
|
-
*
|
|
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
|
-
*
|
|
3077
|
-
* `
|
|
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
|
-
*
|
|
3142
|
-
*
|
|
3143
|
-
*
|
|
3144
|
-
*
|
|
3145
|
-
*
|
|
3146
|
-
*
|
|
3147
|
-
*
|
|
3148
|
-
*
|
|
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,5 +1,5 @@
|
|
|
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-
|
|
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,
|
|
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
|
|
@@ -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,37 @@ 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;
|
|
77
125
|
/**
|
|
78
126
|
* Card-only ids on purchase.disputed. `null` on a storefront chargeback (for example a
|
|
79
127
|
* Steam chargeback, which has no payment intent, charge or dispute id).
|
|
@@ -140,7 +188,21 @@ interface PlatformCommercePurchasedData {
|
|
|
140
188
|
new_balance?: string;
|
|
141
189
|
/** Card leg only (the USD charged). */
|
|
142
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
|
+
*/
|
|
143
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;
|
|
144
206
|
/**
|
|
145
207
|
* Merchant of Record accounts only (card sales): the receipt INVO issued to the buyer.
|
|
146
208
|
* Absent on Open accounts and storefront rails.
|
|
@@ -150,8 +212,9 @@ interface PlatformCommercePurchasedData {
|
|
|
150
212
|
receipt_url?: string;
|
|
151
213
|
[key: string]: unknown;
|
|
152
214
|
}
|
|
153
|
-
/** `platform_commerce.refunded
|
|
154
|
-
*
|
|
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`). */
|
|
155
218
|
interface PlatformCommerceRefundedData {
|
|
156
219
|
order_id: string | number;
|
|
157
220
|
/** "balance" | "card". */
|
|
@@ -171,6 +234,17 @@ interface PlatformCommerceRefundedData {
|
|
|
171
234
|
receipt_number?: string;
|
|
172
235
|
/** Merchant of Record only: link to the printable refund receipt page. */
|
|
173
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;
|
|
174
248
|
[key: string]: unknown;
|
|
175
249
|
}
|
|
176
250
|
interface TransferEventData {
|
|
@@ -247,9 +321,12 @@ interface SubscriptionRenewalFunding {
|
|
|
247
321
|
[key: string]: unknown;
|
|
248
322
|
}
|
|
249
323
|
/**
|
|
250
|
-
* The fee split for one renewal. On the card rail INVO's fee is
|
|
251
|
-
*
|
|
252
|
-
*
|
|
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
|
|
253
330
|
* event's top-level `amount_usd`).
|
|
254
331
|
*/
|
|
255
332
|
interface SubscriptionRenewalSplit {
|
|
@@ -261,6 +338,23 @@ interface SubscriptionRenewalSplit {
|
|
|
261
338
|
invo_fee_coins: string;
|
|
262
339
|
partner_revenue_coins: string;
|
|
263
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;
|
|
264
358
|
[key: string]: unknown;
|
|
265
359
|
}
|
|
266
360
|
/** Revenue-share attribution on a renewal. INVO pays nothing (`settled_by_invo: false`). */
|
|
@@ -1128,17 +1222,27 @@ declare class InvoServer {
|
|
|
1128
1222
|
* - rail "game": returns status "pending_payment" + paymentUrl (redirect the browser).
|
|
1129
1223
|
* - rail "steam": NOT a browser flow — the backend returns WRONG_RAIL_ENDPOINT.
|
|
1130
1224
|
*
|
|
1131
|
-
* INVO's card fee (
|
|
1132
|
-
*
|
|
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:
|
|
1133
1230
|
* - with `acknowledgedTotalUsd` (the `totalUsd` from {@link quoteCurrencyPurchase}): the
|
|
1134
|
-
* card is charged that total and the coins are priced off `usdAmount`.
|
|
1135
|
-
*
|
|
1136
|
-
*
|
|
1137
|
-
*
|
|
1138
|
-
*
|
|
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.
|
|
1139
1241
|
*
|
|
1140
|
-
* A `success` result reports `processingFeeUsd
|
|
1141
|
-
* `
|
|
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.
|
|
1142
1246
|
*/
|
|
1143
1247
|
purchaseCurrency(input: PurchaseInput, opts?: CallOptions): Promise<PurchaseResult>;
|
|
1144
1248
|
/**
|
|
@@ -1146,14 +1250,17 @@ declare class InvoServer {
|
|
|
1146
1250
|
* creates nothing, so it is safe to call on every price render (`POST
|
|
1147
1251
|
* /api/currency-purchases/quote`, authenticated by your game secret like the purchase).
|
|
1148
1252
|
*
|
|
1149
|
-
*
|
|
1150
|
-
*
|
|
1151
|
-
*
|
|
1152
|
-
*
|
|
1153
|
-
*
|
|
1154
|
-
*
|
|
1155
|
-
*
|
|
1156
|
-
*
|
|
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.
|
|
1157
1264
|
*
|
|
1158
1265
|
* Refusals: `400 INVALID_INPUT` (amount missing, not above zero, or above INVO's card
|
|
1159
1266
|
* maximum), `400 CURRENCY_NOT_CONFIGURED`, `503 RATE_UNAVAILABLE`.
|