@invonetwork/web-sdk 3.13.0 → 3.14.1

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.
@@ -329,6 +329,25 @@ declare class InvoError extends Error {
329
329
  * success, not a failure to retry-loop.
330
330
  */
331
331
  get isAlreadyRefunded(): boolean;
332
+ /**
333
+ * Platform Commerce card sale already refunded in part (409
334
+ * `REFUND_REMAINING_REQUIRES_CONFIRMATION`): nothing moved. Retry with
335
+ * `refundRemaining: true` to refund the rest; `refunded_total_usd` and `remaining_usd` are
336
+ * on `err.body`.
337
+ */
338
+ get isRefundRemainingRequiresConfirmation(): boolean;
339
+ /**
340
+ * A Platform Commerce refund of this order was applied in the last 120 seconds (409
341
+ * `REFUND_RECENTLY_ISSUED`): nothing moved. Re-read the order; send
342
+ * `confirmAdditionalRefund: true` to refund anyway.
343
+ */
344
+ get isRefundRecentlyIssued(): boolean;
345
+ /**
346
+ * The Platform Commerce card refund failed, was canceled or still needs an action (502
347
+ * `REFUND_NOT_COMPLETED`): nothing was recorded. Retry; a refund that was in fact created
348
+ * is found and recorded on the retry, never issued twice.
349
+ */
350
+ get isRefundNotCompleted(): boolean;
332
351
  /**
333
352
  * True when an approve / confirm-receipt was refused because the transaction is no
334
353
  * longer awaiting that step (`TRANSACTION_NOT_PENDING`, 400). `approveWithDeviceCode`
@@ -873,6 +892,18 @@ interface PurchaseResult {
873
892
  coinsCredited?: string;
874
893
  /** What the card was charged, decimal string (fee and any tax included). Present on a `success` response. */
875
894
  chargeTotalUsd?: string;
895
+ /**
896
+ * Merchant of Record accounts only: the number of the receipt INVO issued to the buyer for
897
+ * this card sale (for example `"IR-2026-00000123"`; `"IRS-..."` on the sandbox). Absent on
898
+ * Open accounts, on storefront rails, and until the receipt has been issued.
899
+ */
900
+ receiptNumber?: string;
901
+ /**
902
+ * Merchant of Record accounts only: a link to the printable receipt page (no login). Anyone
903
+ * with the link can read the receipt, so treat it like the receipt itself. Absent whenever
904
+ * `receiptNumber` is.
905
+ */
906
+ receiptUrl?: string;
876
907
  raw: Record<string, unknown>;
877
908
  }
878
909
  /**
@@ -899,6 +930,11 @@ interface CurrencyPurchaseQuoteInput {
899
930
  interface CurrencyPurchaseQuoteBreakdown {
900
931
  subtotalUsd: string;
901
932
  taxUsd: string;
933
+ /**
934
+ * Why the tax is what it is. `"partner_responsible"` on an Open-tier account (you are the
935
+ * seller; INVO charged no tax). On Merchant of Record, how INVO handled it (for example
936
+ * `"collected"`). Treat an unknown value as informational.
937
+ */
902
938
  taxTreatment: string | null;
903
939
  /** A sentence you can show as is. */
904
940
  taxNote: string;
@@ -934,7 +970,10 @@ interface CurrencyPurchaseQuote {
934
970
  amountCents: number;
935
971
  /** The listed price (your `usdAmount`). */
936
972
  subtotalUsd: string;
937
- /** INVO's card fee on top of the price: 3.5% + $0.30, never less than the card cost. */
973
+ /**
974
+ * INVO's card fee on top of the price: 3.5% + $0.30 on the Open tier (5% + $0.30 on
975
+ * Merchant of Record), never less than the card cost. Read the figure; do not recompute it.
976
+ */
938
977
  processingFeeUsd: string;
939
978
  /** Coins the player receives on an acknowledged purchase. */
940
979
  coins: string;
@@ -949,9 +988,27 @@ interface CurrencyPurchaseQuote {
949
988
  raw: Record<string, unknown>;
950
989
  }
951
990
  interface ConfirmPaymentResult {
991
+ /** `"success"` whenever the payment succeeded (unchanged). Read `credited` for the coins. */
952
992
  status: string;
953
993
  transactionId?: string;
954
994
  newBalance?: string | number | null;
995
+ /**
996
+ * Additive (backends from 2026-09-24). `status: "success"` means the PAYMENT succeeded; it
997
+ * does not by itself mean the coins were added. `true`: the coins are in the balance (added
998
+ * by this call or an earlier one). `false`: the payment succeeded and the coins were NOT
999
+ * added: see `reasonCode`. Report a completed purchase only when this is `true`. `undefined`
1000
+ * on an older backend: fall back to the order status (`getOrderDetails`).
1001
+ */
1002
+ credited?: boolean;
1003
+ /**
1004
+ * Present when `credited` is `false`. A `CREDIT_REFUSED_*` code (for example
1005
+ * `"CREDIT_REFUSED_MINT_CEILING"`) means the buyer's money was taken and no coins were added:
1006
+ * INVO is alerted, and the buyer must NOT be asked to pay again. `"REFUNDED"` or
1007
+ * `"CHARGEBACK_LOST"` means the payment went back to the buyer. `null` means the credit is
1008
+ * still being finished: poll `getOrderDetails` until the order is `completed`. `undefined`
1009
+ * when `credited` is not `false`.
1010
+ */
1011
+ reasonCode?: string | null;
955
1012
  raw: Record<string, unknown>;
956
1013
  }
957
1014
  /** Shape of the order-details reads (currency purchase + item purchase). */
@@ -959,6 +1016,13 @@ interface OrderDetailsResult {
959
1016
  order: Record<string, unknown>;
960
1017
  financialSummary: Record<string, unknown>;
961
1018
  statusTimeline: unknown;
1019
+ /**
1020
+ * Currency purchases on a Merchant of Record account only: the receipt INVO issued to the
1021
+ * buyer, once issued. Absent on Open, on storefront rails and on item purchases.
1022
+ */
1023
+ receiptNumber?: string;
1024
+ /** Merchant of Record only: link to the printable receipt page. Anyone with it can read it. */
1025
+ receiptUrl?: string;
962
1026
  raw: Record<string, unknown>;
963
1027
  }
964
1028
  interface ItemHistoryResult {
@@ -1056,7 +1120,7 @@ interface SteamFinalizeInput {
1056
1120
  orderId: string;
1057
1121
  }
1058
1122
  interface SteamFinalizeResult {
1059
- /** "success" once captured and credited. */
1123
+ /** `"success"` once Steam captured the payment (unchanged). Read `credited` for the currency. */
1060
1124
  status: string;
1061
1125
  orderId?: string;
1062
1126
  transactionId?: string;
@@ -1068,9 +1132,27 @@ interface SteamFinalizeResult {
1068
1132
  * balance from the original success, or from `playerBalance()` if you need
1069
1133
  * it fresh. (Documented wrong as "the current balance" until the audit
1070
1134
  * checked the replay body against the backend, which returns only
1071
- * status/order/transaction ids.)
1135
+ * status/order/transaction ids.) Also `true` whenever this call added nothing, including a
1136
+ * refused credit, so read `credited` rather than this.
1072
1137
  */
1073
1138
  alreadyProcessed: boolean;
1139
+ /**
1140
+ * Additive (backends from 2026-09-24). `status: "success"` means the PAYMENT succeeded; it
1141
+ * does not by itself mean the coins were added. `true`: the coins are in the balance (added
1142
+ * by this call or an earlier one). `false`: the payment succeeded and the coins were NOT
1143
+ * added: see `reasonCode`. Report a completed purchase only when this is `true`. `undefined`
1144
+ * on an older backend: fall back to the order status (`getOrderDetails`).
1145
+ */
1146
+ credited?: boolean;
1147
+ /**
1148
+ * Present when `credited` is `false`. A `CREDIT_REFUSED_*` code (for example
1149
+ * `"CREDIT_REFUSED_MINT_CEILING"`) means the buyer's money was taken and no coins were added:
1150
+ * INVO is alerted, and the buyer must NOT be asked to pay again. `"REFUNDED"` or
1151
+ * `"CHARGEBACK_LOST"` means the payment went back to the buyer. `null` means the credit is
1152
+ * still being finished: poll `getOrderDetails` until the order is `completed`. `undefined`
1153
+ * when `credited` is not `false`.
1154
+ */
1155
+ reasonCode?: string | null;
1074
1156
  raw: Record<string, unknown>;
1075
1157
  }
1076
1158
  interface PurchaseItemInput {
@@ -1186,6 +1268,18 @@ interface PlatformOrderStatusResult {
1186
1268
  usdAmount?: string | number | null;
1187
1269
  paymentMethod?: string;
1188
1270
  createdAt?: string;
1271
+ /**
1272
+ * Merchant of Record accounts only: the number of the receipt INVO issued to the buyer for
1273
+ * this card sale (for example `"IR-2026-00000123"`; `"IRS-..."` on the sandbox). Absent on
1274
+ * Open accounts, on storefront rails, and until the receipt has been issued.
1275
+ */
1276
+ receiptNumber?: string;
1277
+ /**
1278
+ * Merchant of Record accounts only: a link to the printable receipt page (no login). Anyone
1279
+ * with the link can read the receipt, so treat it like the receipt itself. Absent whenever
1280
+ * `receiptNumber` is.
1281
+ */
1282
+ receiptUrl?: string;
1189
1283
  raw: Record<string, unknown>;
1190
1284
  }
1191
1285
  interface PlatformRefundInput {
@@ -1193,6 +1287,18 @@ interface PlatformRefundInput {
1193
1287
  orderId?: string | number;
1194
1288
  clientRequestId?: string;
1195
1289
  reason?: string;
1290
+ /**
1291
+ * Card sale already refunded in part: refund what is left. Sent only when `true`. Without
1292
+ * it such a refund is refused with 409 `REFUND_REMAINING_REQUIRES_CONFIRMATION`
1293
+ * (`err.isRefundRemainingRequiresConfirmation`).
1294
+ */
1295
+ refundRemaining?: boolean;
1296
+ /**
1297
+ * Refund anyway within 120 seconds of the order's last refund. Sent only when `true`.
1298
+ * Without it such a refund is refused with 409 `REFUND_RECENTLY_ISSUED`
1299
+ * (`err.isRefundRecentlyIssued`).
1300
+ */
1301
+ confirmAdditionalRefund?: boolean;
1196
1302
  }
1197
1303
  interface PlatformRefundResult {
1198
1304
  /** "refunded" on success. A second refund of the same order throws a 409
@@ -1214,6 +1320,20 @@ interface PlatformRefundResult {
1214
1320
  processorRefundId?: string;
1215
1321
  /** Always true — INVO retains its fee; the customer is made whole minus that fee. */
1216
1322
  feeRetained?: boolean;
1323
+ /**
1324
+ * Card sale refunded in parts only (absent on a one-shot full refund): `true` while part
1325
+ * of the charge is still refundable, `false` on the refund that completes it.
1326
+ * `refundedAmount` and the other figures are then this refund's own share.
1327
+ */
1328
+ partialRefund?: boolean;
1329
+ /** Present and `true` only when this call recorded a refund that already existed; no new money moved. */
1330
+ adopted?: boolean;
1331
+ /** Refunds in parts only: the USD refunded on this order so far, this refund included. */
1332
+ refundedTotalUsd?: string;
1333
+ /** Refunds in parts only: the whole card charge, USD. */
1334
+ chargeTotalUsd?: string;
1335
+ /** Present only while something is left: the USD still refundable (send `refundRemaining: true`). */
1336
+ remainingUsd?: string;
1217
1337
  raw: Record<string, unknown>;
1218
1338
  }
1219
1339
  interface MountCheckoutOptions {
@@ -1991,6 +2111,18 @@ interface FirstCharge {
1991
2111
  confirmationUrl: string | null;
1992
2112
  expiresAt: string | null;
1993
2113
  message: string | null;
2114
+ /**
2115
+ * Merchant of Record accounts only: the number of the receipt INVO issued to the buyer for
2116
+ * this paid first period (for example `"IR-2026-00000123"`; `"IRS-..."` on the sandbox). Absent on
2117
+ * Open accounts, on storefront rails, and until the receipt has been issued.
2118
+ */
2119
+ receiptNumber?: string;
2120
+ /**
2121
+ * Merchant of Record accounts only: a link to the printable receipt page (no login). Anyone
2122
+ * with the link can read the receipt, so treat it like the receipt itself. Absent whenever
2123
+ * `receiptNumber` is.
2124
+ */
2125
+ receiptUrl?: string;
1994
2126
  raw: Record<string, unknown>;
1995
2127
  }
1996
2128
  /** Fields shared by `subscriptions.create` and `subscriptions.steamInit`. */
@@ -2661,6 +2793,18 @@ interface PurchaseStatusResult {
2661
2793
  listedUsd: string | null;
2662
2794
  /** What the coins are called in this game, for your own copy. */
2663
2795
  currencyName: string | null;
2796
+ /**
2797
+ * Merchant of Record accounts only: the number of the receipt INVO issued to the buyer for
2798
+ * this card sale (for example `"IR-2026-00000123"`; `"IRS-..."` on the sandbox). Absent on
2799
+ * Open accounts, on storefront rails, on every status but `credited`, and until the receipt has been issued.
2800
+ */
2801
+ receiptNumber?: string;
2802
+ /**
2803
+ * Merchant of Record accounts only: a link to the printable receipt page (no login). Anyone
2804
+ * with the link can read the receipt, so treat it like the receipt itself. Absent whenever
2805
+ * `receiptNumber` is.
2806
+ */
2807
+ receiptUrl?: string;
2664
2808
  raw: Record<string, unknown>;
2665
2809
  }
2666
2810
  /** A {@link PurchaseStatusResult} narrowed by {@link isPurchaseCredited}. */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@invonetwork/web-sdk",
3
- "version": "3.13.0",
3
+ "version": "3.14.1",
4
4
  "description": "INVO Web SDK — currency purchase + passkey (WebAuthn) verification for partner web platforms.",
5
5
  "license": "SEE LICENSE IN LICENSE",
6
6
  "private": false,