@invonetwork/web-sdk 3.11.0 → 3.12.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 +28 -0
- package/README.md +34 -5
- package/dist/{chunk-ZDBU3L4T.js → chunk-5BMM5ZTW.js} +11 -4
- package/dist/index.cjs +9 -2
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +2 -2
- package/dist/server.cjs +15 -13
- package/dist/server.d.cts +7 -4
- package/dist/server.d.ts +7 -4
- package/dist/server.js +8 -13
- package/dist/{types-DSLGe_0Z.d.cts → types-CT0Ksonp.d.cts} +20 -4
- package/dist/{types-DSLGe_0Z.d.ts → types-CT0Ksonp.d.ts} +20 -4
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,33 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 3.12.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- The card maximum is INVO's, not the SDK's.
|
|
8
|
+
|
|
9
|
+
**INVO raised the maximum single card charge from $999.99 to $100,000.00 on 2026-09-18, and this package was refusing it.** The old limit was enforced client-side and threw before any network call, so a partner charging $50,000 failed inside the SDK and INVO never saw the request. The backend raise was invisible to every SDK user until this release. Per-customer velocity limits rose with it, to 100,000 per hour, 200,000 per day and 1,000,000 per month, all enforced by INVO.
|
|
10
|
+
|
|
11
|
+
**The design decision: the floor is a fact, the ceiling is a policy, and only facts belong in a client.**
|
|
12
|
+
|
|
13
|
+
$0.50 is the card rail's own minimum charge. Below it nothing settles in any environment, INVO holds it as a plain constant rather than a setting, and no configuration makes a smaller amount chargeable. That check stays exactly where it was and still throws before any request (`BELOW_STRIPE_MINIMUM`, `err.isBelowCardMinimum`).
|
|
14
|
+
|
|
15
|
+
The maximum is the opposite. It is a runtime setting an INVO admin edits without a deploy, and it differs between sandbox and production. Any number pinned in a published package is stale the moment somebody changes it, and the only remedy is a release, which is precisely the failure this release is repairing. So the local ceiling is **removed** rather than re-pinned at $100,000.00. It was not replaced by a fetch of the live limits either: that would turn one purchase call into two network calls, add a failure mode and a cache to a money path, and still be a snapshot rather than the truth at the moment of charge, because only the request itself is evaluated against the setting in force.
|
|
16
|
+
|
|
17
|
+
What remains is a structural bound. `usdAmount` and a card `totalPrice` must still be a positive amount with at most two decimals, and must still be at most `999999.99`, the same house ceiling every other money field in this SDK uses. That figure is deliberately **above** the largest value INVO's setting is permitted to take, so it can never refuse an amount INVO would have accepted. The invariant for anyone editing this later: the local bound must never be tighter than the server's maximum possible limit. This SDK may cost you a wasted round trip. It must never cost you a sale that a package upgrade would have allowed.
|
|
18
|
+
|
|
19
|
+
**What changed for you**
|
|
20
|
+
|
|
21
|
+
- Amounts between `999.99` and `999999.99` are now sent instead of being rejected locally. Nothing that worked before stops working; the validation only loosened.
|
|
22
|
+
- `err.isAboveCardMaximum` is unchanged and still means what it always meant, but it now arrives only from INVO (a `400`), never from the SDK. Nothing was charged.
|
|
23
|
+
- An amount above `999999.99` now throws `INVALID_INPUT` where it previously threw `ABOVE_CARD_MAXIMUM`. That range is malformed input, not a policy refusal, and INVO classifies it the same way.
|
|
24
|
+
|
|
25
|
+
**When INVO refuses an amount the SDK allowed**, catch `err.isAboveCardMaximum`. `err.message` carries the figure that was in force for that request, for example "Card purchases must be $100,000.00 or less." Do not retry it unchanged: lower the amount, split the sale, or ask INVO to raise the setting. The live figure for a tenant is also the `max_amount` of the hosted checkout's `validate-game` read, next to `min_amount`; read that if you want to show a limit in your own UI, and re-read it, because it can change under you. A velocity limit is a `429` with `err.retryAfter`, not this error.
|
|
26
|
+
|
|
27
|
+
**README: the minimum is $0.50.** The docs said only `0 < x <= 999.99` and left the floor unstated. They now state $0.50, which is what INVO advertises and what the card rail actually enforces. A $1.00 minimum was advertised by INVO's own checkout read until 2026-09-18 and was enforced nowhere; it is gone rather than enforced, because enforcing it would newly refuse charges between $0.50 and $0.99 that settle today.
|
|
28
|
+
|
|
29
|
+
No export was added, removed, renamed or retyped.
|
|
30
|
+
|
|
3
31
|
## 3.11.0
|
|
4
32
|
|
|
5
33
|
### Minor Changes
|
package/README.md
CHANGED
|
@@ -96,6 +96,7 @@ The right approval method is a property of the **client the player is sitting in
|
|
|
96
96
|
- [Before you go live](#before-you-go-live)
|
|
97
97
|
- [Configuration](#configuration)
|
|
98
98
|
- [Currency purchase (real money in)](#currency-purchase-real-money-in)
|
|
99
|
+
- [The card maximum is INVO's, not the SDK's](#the-card-maximum-is-invos-not-the-sdks)
|
|
99
100
|
- [Did the purchase go through? (the status read)](#did-the-purchase-go-through-the-status-read)
|
|
100
101
|
- [Item purchase (spend game currency)](#item-purchase-spend-game-currency)
|
|
101
102
|
- [Platform Commerce (ecommerce)](#platform-commerce-ecommerce)
|
|
@@ -284,13 +285,41 @@ const client = new InvoClient({
|
|
|
284
285
|
|
|
285
286
|
Buy game currency with real money. Authenticated by the **payment rail**, not a passkey — there's no WebAuthn step. Two paths:
|
|
286
287
|
|
|
288
|
+
### The card maximum is INVO's, not the SDK's
|
|
289
|
+
|
|
290
|
+
**Minimum: $0.50.** That is the card rail's own floor: below it a charge cannot settle at all, so this SDK checks it locally and always will.
|
|
291
|
+
|
|
292
|
+
**Maximum: an INVO setting, $100,000.00 by default.** It is changed by an INVO admin without a deploy, and it differs between sandbox and production, so **this package does not pin it and never refuses an amount for being too large.** Your amount is sent; INVO decides.
|
|
293
|
+
|
|
294
|
+
Before 3.12.0 the SDK enforced a hard-coded $999.99 and threw before any request was made, so a partner charging $50,000 failed inside the SDK and INVO never heard about it. A pinned limit is wrong by construction here: the moment anyone edits the setting, every installed copy of the SDK is stale, and the only fix is a release. Removing the local ceiling means the SDK can waste a round trip on an amount INVO refuses; keeping it meant the SDK could block a sale INVO would have taken. Only one of those is recoverable without a package upgrade.
|
|
295
|
+
|
|
296
|
+
**When INVO refuses an amount this SDK allowed**, you get a `400` and `err.isAboveCardMaximum === true`. Nothing was charged.
|
|
297
|
+
|
|
298
|
+
```ts
|
|
299
|
+
try {
|
|
300
|
+
await server.createCheckout({ playerEmail, usdAmount: "50000.00" });
|
|
301
|
+
} catch (err) {
|
|
302
|
+
if (err.isAboveCardMaximum) {
|
|
303
|
+
// err.message carries the figure in force for THIS environment, e.g.
|
|
304
|
+
// "Card purchases must be $100,000.00 or less." Do not retry it unchanged:
|
|
305
|
+
// lower the amount, split the sale, or ask INVO to raise the setting.
|
|
306
|
+
console.warn(err.message);
|
|
307
|
+
}
|
|
308
|
+
}
|
|
309
|
+
```
|
|
310
|
+
|
|
311
|
+
The live figure for a tenant is also the `max_amount` of the hosted checkout's `validate-game` read, alongside `min_amount`. Read it if you want to show a limit in your own UI rather than hard-coding one, and re-read it, because it can change under you.
|
|
312
|
+
|
|
313
|
+
Per-customer velocity limits sit underneath the per-charge maximum (hourly, daily and monthly, per player per game) and are INVO's too. Exceeding one is a `429`; see `err.retryAfter`.
|
|
314
|
+
|
|
287
315
|
### Hosted checkout (recommended — PCI-light, you never touch card data)
|
|
288
316
|
|
|
289
317
|
```ts
|
|
290
318
|
// SERVER
|
|
291
319
|
const { checkoutUrl, sessionId, sessionToken, expiresAt, expiresInSeconds } = await server.createCheckout({
|
|
292
320
|
playerEmail: "p@example.com",
|
|
293
|
-
usdAmount: "20.00", // USD
|
|
321
|
+
usdAmount: "20.00", // USD. Minimum $0.50. The maximum is an INVO setting
|
|
322
|
+
// ($100,000.00 by default) and is enforced on the request.
|
|
294
323
|
rail: "platform", // optional: "platform" (default) | "game" | "steam"
|
|
295
324
|
successUrl: "https://you/buy/ok",
|
|
296
325
|
cancelUrl: "https://you/buy/cancel",
|
|
@@ -603,7 +632,7 @@ const r = await server.platformCommerce.purchase({
|
|
|
603
632
|
|
|
604
633
|
### Card leg — server creates, INVO hosts the checkout
|
|
605
634
|
|
|
606
|
-
**INVO hosts the entire card checkout** — card fields, Apple Pay / Google Pay, the international billing-address collector, and 3-D Secure all live on INVO's page. There is **no billing address in the request, no card element, no processor dependency, and no client payment code to write**: the server call returns a `checkoutUrl` and you send the buyer there. `totalPrice` is **USD
|
|
635
|
+
**INVO hosts the entire card checkout** — card fields, Apple Pay / Google Pay, the international billing-address collector, and 3-D Secure all live on INVO's page. There is **no billing address in the request, no card element, no processor dependency, and no client payment code to write**: the server call returns a `checkoutUrl` and you send the buyer there. `totalPrice` is **USD**, at least **$0.50**. The maximum is an INVO setting, **$100,000.00 by default**, so it is enforced on the request and not pinned in this package.
|
|
607
636
|
|
|
608
637
|
```ts
|
|
609
638
|
// 1) server — returns a hosted-checkout session, NOT yet paid
|
|
@@ -653,8 +682,8 @@ const ref = await server.platformCommerce.refund({ orderId: r.orderId, reason: "
|
|
|
653
682
|
```
|
|
654
683
|
|
|
655
684
|
- **Idempotency on `clientRequestId`:** a duplicate BALANCE purchase throws `409` (`err.isDuplicateRequest`); a duplicate CARD purchase **replays the same checkout session** (`r.idempotentReplay === true`, same URL — never a second charge), so a lost card-leg response is safely recovered by retrying with the *same* `clientRequestId`.
|
|
656
|
-
- INVO fee: **3.5% flat** (balance) · **3.5% + $0.30** (card). Too-small amounts throw `err.isAmountBelowMinimum` / `err.isBelowCardMinimum` (card < $0.50); a card total over
|
|
657
|
-
- Client-side validation (missing fields, bad funding source, quantity outside `1..1000`, total ≠ unit×qty, card
|
|
685
|
+
- INVO fee: **3.5% flat** (balance) · **3.5% + $0.30** (card). Too-small amounts throw `err.isAmountBelowMinimum` / `err.isBelowCardMinimum` (card < $0.50); a card total over INVO's maximum single card charge comes back as `err.isAboveCardMaximum` (400) with the live figure in `err.message`.
|
|
686
|
+
- Client-side validation (missing fields, bad funding source, quantity outside `1..1000`, total ≠ unit×qty, card total under $0.50, non-E.164 `playerPhone`) throws **before** any network call. The card **maximum** is deliberately not among them: see [The card maximum is INVO's, not the SDK's](#the-card-maximum-is-invos-not-the-sdks).
|
|
658
687
|
- Fulfill on the **`platform_commerce.purchased`** webhook; handle **`platform_commerce.refunded`** for reversals.
|
|
659
688
|
|
|
660
689
|
---
|
|
@@ -2004,7 +2033,7 @@ Helpers:
|
|
|
2004
2033
|
| `.isInsufficientBalance` | item purchase failed (400); `required_amount` + `current_balance` on `.body` |
|
|
2005
2034
|
| `.isDuplicateRequest` | idempotency-keyed request was a duplicate (409) |
|
|
2006
2035
|
| `.isNotPlatformTenant` | Platform Commerce called by a non-platform tenant (403) — use `purchaseItem`/`createCheckout` instead |
|
|
2007
|
-
| `.isAmountBelowMinimum` / `.isBelowCardMinimum` / `.isAboveCardMaximum` |
|
|
2036
|
+
| `.isAmountBelowMinimum` / `.isBelowCardMinimum` / `.isAboveCardMaximum` | amount too small for the fee to round up / card charge under $0.50 / card charge over INVO's maximum single card charge, which is a runtime setting (400) |
|
|
2008
2037
|
| `.isAlreadyRefunded` | Platform Commerce refund of an already-refunded order (409) — treat as already done |
|
|
2009
2038
|
| `.retryAfter` | seconds to back off on a 429 throttle |
|
|
2010
2039
|
| `.isEnrollmentAuthorizationRequired` | first-enrollment needs the OTP grant → `enrollmentBegin`/`enrollmentVerify` |
|
|
@@ -369,8 +369,15 @@ var InvoError = class _InvoError extends Error {
|
|
|
369
369
|
get isBelowCardMinimum() {
|
|
370
370
|
return this.code === "BELOW_CARD_MINIMUM" || this.rawCode === "BELOW_STRIPE_MINIMUM";
|
|
371
371
|
}
|
|
372
|
-
/** True if a
|
|
373
|
-
*
|
|
372
|
+
/** True if a CARD purchase exceeded INVO's maximum single card charge
|
|
373
|
+
* (`ABOVE_CARD_MAXIMUM`, 400) — split the sale or lower the amount. Do not retry it
|
|
374
|
+
* unchanged; nothing was charged.
|
|
375
|
+
*
|
|
376
|
+
* The cap is a runtime setting ($100,000.00 by default since 2026-09-18), editable by
|
|
377
|
+
* an INVO admin without a deploy and different per environment, so this SDK does not
|
|
378
|
+
* pin it and never raises this error locally. `err.message` carries the figure that was
|
|
379
|
+
* in force for the request that failed; the live figure for a tenant is also the
|
|
380
|
+
* `max_amount` of the hosted checkout's `validate-game` read. */
|
|
374
381
|
get isAboveCardMaximum() {
|
|
375
382
|
return this.code === "ABOVE_CARD_MAXIMUM";
|
|
376
383
|
}
|
|
@@ -977,5 +984,5 @@ function toDestinationsResult(raw, direction) {
|
|
|
977
984
|
}
|
|
978
985
|
|
|
979
986
|
export { Http, InvoError, assertSecureBaseUrl, toDestinationsResult };
|
|
980
|
-
//# sourceMappingURL=chunk-
|
|
981
|
-
//# sourceMappingURL=chunk-
|
|
987
|
+
//# sourceMappingURL=chunk-5BMM5ZTW.js.map
|
|
988
|
+
//# sourceMappingURL=chunk-5BMM5ZTW.js.map
|
package/dist/index.cjs
CHANGED
|
@@ -371,8 +371,15 @@ var InvoError = class _InvoError extends Error {
|
|
|
371
371
|
get isBelowCardMinimum() {
|
|
372
372
|
return this.code === "BELOW_CARD_MINIMUM" || this.rawCode === "BELOW_STRIPE_MINIMUM";
|
|
373
373
|
}
|
|
374
|
-
/** True if a
|
|
375
|
-
*
|
|
374
|
+
/** True if a CARD purchase exceeded INVO's maximum single card charge
|
|
375
|
+
* (`ABOVE_CARD_MAXIMUM`, 400) — split the sale or lower the amount. Do not retry it
|
|
376
|
+
* unchanged; nothing was charged.
|
|
377
|
+
*
|
|
378
|
+
* The cap is a runtime setting ($100,000.00 by default since 2026-09-18), editable by
|
|
379
|
+
* an INVO admin without a deploy and different per environment, so this SDK does not
|
|
380
|
+
* pin it and never raises this error locally. `err.message` carries the figure that was
|
|
381
|
+
* in force for the request that failed; the live figure for a tenant is also the
|
|
382
|
+
* `max_amount` of the hosted checkout's `validate-game` read. */
|
|
376
383
|
get isAboveCardMaximum() {
|
|
377
384
|
return this.code === "ABOVE_CARD_MAXIMUM";
|
|
378
385
|
}
|
package/dist/index.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { A as ApproveResult, C as ConfirmReceiptResult, P as PurchaseStatusResult, a as PurchaseCredited, b as PurchaseExpired, c as PurchaseRefunded, d as PurchaseRefused, e as CheckoutClientConfig, H as Http, f as PurchaseStatusInput, g as CallOptions, W as WaitForPurchaseInput, M as MountCheckoutOptions, h as CheckoutMountHandle, i as ClientConfig, L as LinkDeviceResult, j as PendingCollectResult, D as DestinationsQuery, k as DestinationsResult, B as BalanceResult, E as EnrollmentBeginResult, l as EnrollmentVerifyResult, R as RecoveryBeginResult, m as RecoveryCompleteResult } from './types-
|
|
2
|
-
export { n as BalanceRow, o as CheckoutPurchaseStatus, p as DestinationGame, I as InvoError, q as InvoErrorInfo, r as InvoHooks, s as InvoRequestInfo, t as InvoResponseInfo, u as PendingCollectItem, v as PurchaseRefusalReason, w as Rail, V as VerificationMethod } from './types-
|
|
1
|
+
import { A as ApproveResult, C as ConfirmReceiptResult, P as PurchaseStatusResult, a as PurchaseCredited, b as PurchaseExpired, c as PurchaseRefunded, d as PurchaseRefused, e as CheckoutClientConfig, H as Http, f as PurchaseStatusInput, g as CallOptions, W as WaitForPurchaseInput, M as MountCheckoutOptions, h as CheckoutMountHandle, i as ClientConfig, L as LinkDeviceResult, j as PendingCollectResult, D as DestinationsQuery, k as DestinationsResult, B as BalanceResult, E as EnrollmentBeginResult, l as EnrollmentVerifyResult, R as RecoveryBeginResult, m as RecoveryCompleteResult } from './types-CT0Ksonp.cjs';
|
|
2
|
+
export { n as BalanceRow, o as CheckoutPurchaseStatus, p as DestinationGame, I as InvoError, q as InvoErrorInfo, r as InvoHooks, s as InvoRequestInfo, t as InvoResponseInfo, u as PendingCollectItem, v as PurchaseRefusalReason, w as Rail, V as VerificationMethod } from './types-CT0Ksonp.cjs';
|
|
3
3
|
|
|
4
4
|
/** The four device-approval flows (`begin.flow`). */
|
|
5
5
|
type HostedFlow = "transfer" | "send" | "send_receipt" | "transfer_receipt";
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { A as ApproveResult, C as ConfirmReceiptResult, P as PurchaseStatusResult, a as PurchaseCredited, b as PurchaseExpired, c as PurchaseRefunded, d as PurchaseRefused, e as CheckoutClientConfig, H as Http, f as PurchaseStatusInput, g as CallOptions, W as WaitForPurchaseInput, M as MountCheckoutOptions, h as CheckoutMountHandle, i as ClientConfig, L as LinkDeviceResult, j as PendingCollectResult, D as DestinationsQuery, k as DestinationsResult, B as BalanceResult, E as EnrollmentBeginResult, l as EnrollmentVerifyResult, R as RecoveryBeginResult, m as RecoveryCompleteResult } from './types-
|
|
2
|
-
export { n as BalanceRow, o as CheckoutPurchaseStatus, p as DestinationGame, I as InvoError, q as InvoErrorInfo, r as InvoHooks, s as InvoRequestInfo, t as InvoResponseInfo, u as PendingCollectItem, v as PurchaseRefusalReason, w as Rail, V as VerificationMethod } from './types-
|
|
1
|
+
import { A as ApproveResult, C as ConfirmReceiptResult, P as PurchaseStatusResult, a as PurchaseCredited, b as PurchaseExpired, c as PurchaseRefunded, d as PurchaseRefused, e as CheckoutClientConfig, H as Http, f as PurchaseStatusInput, g as CallOptions, W as WaitForPurchaseInput, M as MountCheckoutOptions, h as CheckoutMountHandle, i as ClientConfig, L as LinkDeviceResult, j as PendingCollectResult, D as DestinationsQuery, k as DestinationsResult, B as BalanceResult, E as EnrollmentBeginResult, l as EnrollmentVerifyResult, R as RecoveryBeginResult, m as RecoveryCompleteResult } from './types-CT0Ksonp.js';
|
|
2
|
+
export { n as BalanceRow, o as CheckoutPurchaseStatus, p as DestinationGame, I as InvoError, q as InvoErrorInfo, r as InvoHooks, s as InvoRequestInfo, t as InvoResponseInfo, u as PendingCollectItem, v as PurchaseRefusalReason, w as Rail, V as VerificationMethod } from './types-CT0Ksonp.js';
|
|
3
3
|
|
|
4
4
|
/** The four device-approval flows (`begin.flow`). */
|
|
5
5
|
type HostedFlow = "transfer" | "send" | "send_receipt" | "transfer_receipt";
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { InvoError, assertSecureBaseUrl, Http, toDestinationsResult } from './chunk-
|
|
2
|
-
export { InvoError } from './chunk-
|
|
1
|
+
import { InvoError, assertSecureBaseUrl, Http, toDestinationsResult } from './chunk-5BMM5ZTW.js';
|
|
2
|
+
export { InvoError } from './chunk-5BMM5ZTW.js';
|
|
3
3
|
|
|
4
4
|
// src/shared/webauthn.ts
|
|
5
5
|
function malformedOptions(field) {
|
package/dist/server.cjs
CHANGED
|
@@ -373,8 +373,15 @@ var InvoError = class _InvoError extends Error {
|
|
|
373
373
|
get isBelowCardMinimum() {
|
|
374
374
|
return this.code === "BELOW_CARD_MINIMUM" || this.rawCode === "BELOW_STRIPE_MINIMUM";
|
|
375
375
|
}
|
|
376
|
-
/** True if a
|
|
377
|
-
*
|
|
376
|
+
/** True if a CARD purchase exceeded INVO's maximum single card charge
|
|
377
|
+
* (`ABOVE_CARD_MAXIMUM`, 400) — split the sale or lower the amount. Do not retry it
|
|
378
|
+
* unchanged; nothing was charged.
|
|
379
|
+
*
|
|
380
|
+
* The cap is a runtime setting ($100,000.00 by default since 2026-09-18), editable by
|
|
381
|
+
* an INVO admin without a deploy and different per environment, so this SDK does not
|
|
382
|
+
* pin it and never raises this error locally. `err.message` carries the figure that was
|
|
383
|
+
* in force for the request that failed; the live figure for a tenant is also the
|
|
384
|
+
* `max_amount` of the hosted checkout's `validate-game` read. */
|
|
378
385
|
get isAboveCardMaximum() {
|
|
379
386
|
return this.code === "ABOVE_CARD_MAXIMUM";
|
|
380
387
|
}
|
|
@@ -981,7 +988,7 @@ function toDestinationsResult(raw, direction) {
|
|
|
981
988
|
}
|
|
982
989
|
|
|
983
990
|
// src/version.ts
|
|
984
|
-
var SDK_VERSION = "3.
|
|
991
|
+
var SDK_VERSION = "3.12.0";
|
|
985
992
|
|
|
986
993
|
// src/shared/types.ts
|
|
987
994
|
function isRefundPendingApproval(r) {
|
|
@@ -1153,7 +1160,7 @@ async function hmacHexSubtle(secret, message) {
|
|
|
1153
1160
|
|
|
1154
1161
|
// src/server.ts
|
|
1155
1162
|
var DEFAULT_UA = `invonetwork-web-sdk/${SDK_VERSION} (+https://invo.network)`;
|
|
1156
|
-
var MAX_USD_AMOUNT =
|
|
1163
|
+
var MAX_USD_AMOUNT = 999999.99;
|
|
1157
1164
|
var MAX_ITEM_PRICE = 999999.99;
|
|
1158
1165
|
function invalidInput(label, value, why) {
|
|
1159
1166
|
return new InvoError({
|
|
@@ -1455,7 +1462,6 @@ function requireField(value, field, raw) {
|
|
|
1455
1462
|
}
|
|
1456
1463
|
var FUNDING_SOURCES = /* @__PURE__ */ new Set(["balance", "card"]);
|
|
1457
1464
|
var CARD_MIN_USD = 0.5;
|
|
1458
|
-
var CARD_MAX_USD = 999.99;
|
|
1459
1465
|
var PlatformCommerceServer = class {
|
|
1460
1466
|
constructor(http, auth) {
|
|
1461
1467
|
this.http = http;
|
|
@@ -1472,7 +1478,10 @@ var PlatformCommerceServer = class {
|
|
|
1472
1478
|
* Send the buyer to `checkoutUrl` — INVO's hosted page owns the card form, wallets,
|
|
1473
1479
|
* billing address, and 3-D Secure (there is NO billing address in this request, and no
|
|
1474
1480
|
* client payment code to write; optionally embed via
|
|
1475
|
-
* `InvoClient.platformCommerce.mountCheckout`). `totalPrice` is USD
|
|
1481
|
+
* `InvoClient.platformCommerce.mountCheckout`). `totalPrice` is USD, at least $0.50;
|
|
1482
|
+
* the maximum is an INVO setting ($100,000.00 by default) and is enforced on the
|
|
1483
|
+
* request, not here, so read the live figure off `ABOVE_CARD_MAXIMUM` rather than
|
|
1484
|
+
* pinning one.
|
|
1476
1485
|
* The sale is real only on the `platform_commerce.purchased` webhook — never on the
|
|
1477
1486
|
* client return.
|
|
1478
1487
|
*
|
|
@@ -1518,13 +1527,6 @@ var PlatformCommerceServer = class {
|
|
|
1518
1527
|
status: 0
|
|
1519
1528
|
});
|
|
1520
1529
|
}
|
|
1521
|
-
if (total > CARD_MAX_USD) {
|
|
1522
|
-
throw new InvoError({
|
|
1523
|
-
message: `Card purchases must be $${CARD_MAX_USD} or less.`,
|
|
1524
|
-
code: "ABOVE_CARD_MAXIMUM",
|
|
1525
|
-
status: 0
|
|
1526
|
-
});
|
|
1527
|
-
}
|
|
1528
1530
|
}
|
|
1529
1531
|
if (input.playerPhone !== void 0) assertE164(input.playerPhone, "playerPhone");
|
|
1530
1532
|
const body = {
|
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 ConfirmPaymentResult, ap as OrderDetailsResult, aq as SteamPacksQuery, ar as SteamPacksResult, as as SteamInitPurchaseInput, at as SteamInitPurchaseResult, au as SteamFinalizeInput, av as SteamFinalizeResult, aw as PurchaseItemInput, ax as PurchaseItemResult, ay as ItemHistoryQuery, az as ItemHistoryResult, aA as ItemOrderQuery, aB as PlayerBalanceQuery, aC as PlayerBalanceResult, aD as InboundPendingQuery, aE as InboundPendingResult, aF as LinkedIdentitiesQuery, aG as LinkedIdentitiesResult, aH as SmsVerifyResult, aI as ClaimTransferInput, aJ as ClaimResult, aK as ClaimCurrencyInput, aL as TransactionStatusResult, aM as GuardianApprovalStatusResult, aN as ServerDestinationsQuery, k as DestinationsResult, aO as PhoneShareContact, aP as PhoneShareInitiateResult, aQ as PhoneShareApproveInput, aR as PhoneShareApproveResult, aS as PhoneShareStatusResult, aT as BeginDeviceApprovalInput, aU as DeviceApprovalGrant, aV as PollDeviceApprovalInput, aW as DeviceApprovalPollResult, aX as ConfirmDeviceEnrollmentInput, aY as ConfirmDeviceEnrollmentResult, aZ as ApproveWithDeviceCodeInput, a_ as DeviceApprovalSettleResult, a$ as CompleteDeviceApprovalInput, b0 as CompleteDeviceApprovalResult } from './types-
|
|
2
|
-
export { b1 as CardSetupStatus, b2 as CurrencyBalance, p as DestinationGame, b3 as DeviceApprovalChannel, b4 as DeviceApprovalEnrollment, b5 as DeviceApprovalFlow, b6 as DeviceApprovalPollStatus, b7 as DeviceEnrollmentDecision, b8 as DeviceEnrollmentRespond, b9 as FirstCharge, ba as FirstChargeStatus, bb as FundingSource, bc as InboundPendingItem, q as InvoErrorInfo, r as InvoHooks, s as InvoRequestInfo, t as InvoResponseInfo, bd as LinkedIdentityEmail, be as PlatformPurchaseStatus, w as Rail, bf as RefundInitiation, bg as RefundPendingApproval, bh as RefundProcessingFeeBasis, bi as RefundReceipt, bj as RefundRevenueShareAttribution, bk as RefundWarning, bl as SandboxClockState, bm as SavedCard, bn as SteamPack, bo as SteamUserSession, bp as Subscription, bq as SubscriptionBaseInput, br as SubscriptionConsent, bs as SubscriptionConsentInput, bt as SubscriptionFundingRail, bu as SubscriptionInterval, bv as SubscriptionRevenueShare, bw as SubscriptionRevenueShareInput, bx as SubscriptionStatus, V as VerificationMethod, by as isRefundPendingApproval } from './types-
|
|
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 ConfirmPaymentResult, ap as OrderDetailsResult, aq as SteamPacksQuery, ar as SteamPacksResult, as as SteamInitPurchaseInput, at as SteamInitPurchaseResult, au as SteamFinalizeInput, av as SteamFinalizeResult, aw as PurchaseItemInput, ax as PurchaseItemResult, ay as ItemHistoryQuery, az as ItemHistoryResult, aA as ItemOrderQuery, aB as PlayerBalanceQuery, aC as PlayerBalanceResult, aD as InboundPendingQuery, aE as InboundPendingResult, aF as LinkedIdentitiesQuery, aG as LinkedIdentitiesResult, aH as SmsVerifyResult, aI as ClaimTransferInput, aJ as ClaimResult, aK as ClaimCurrencyInput, aL as TransactionStatusResult, aM as GuardianApprovalStatusResult, aN as ServerDestinationsQuery, k as DestinationsResult, aO as PhoneShareContact, aP as PhoneShareInitiateResult, aQ as PhoneShareApproveInput, aR as PhoneShareApproveResult, aS as PhoneShareStatusResult, aT as BeginDeviceApprovalInput, aU as DeviceApprovalGrant, aV as PollDeviceApprovalInput, aW as DeviceApprovalPollResult, aX as ConfirmDeviceEnrollmentInput, aY as ConfirmDeviceEnrollmentResult, aZ as ApproveWithDeviceCodeInput, a_ as DeviceApprovalSettleResult, a$ as CompleteDeviceApprovalInput, b0 as CompleteDeviceApprovalResult } from './types-CT0Ksonp.cjs';
|
|
2
|
+
export { b1 as CardSetupStatus, b2 as CurrencyBalance, p as DestinationGame, b3 as DeviceApprovalChannel, b4 as DeviceApprovalEnrollment, b5 as DeviceApprovalFlow, b6 as DeviceApprovalPollStatus, b7 as DeviceEnrollmentDecision, b8 as DeviceEnrollmentRespond, b9 as FirstCharge, ba as FirstChargeStatus, bb as FundingSource, bc as InboundPendingItem, q as InvoErrorInfo, r as InvoHooks, s as InvoRequestInfo, t as InvoResponseInfo, bd as LinkedIdentityEmail, be as PlatformPurchaseStatus, w as Rail, bf as RefundInitiation, bg as RefundPendingApproval, bh as RefundProcessingFeeBasis, bi as RefundReceipt, bj as RefundRevenueShareAttribution, bk as RefundWarning, bl as SandboxClockState, bm as SavedCard, bn as SteamPack, bo as SteamUserSession, bp as Subscription, bq as SubscriptionBaseInput, br as SubscriptionConsent, bs as SubscriptionConsentInput, bt as SubscriptionFundingRail, bu as SubscriptionInterval, bv as SubscriptionRevenueShare, bw as SubscriptionRevenueShareInput, bx as SubscriptionStatus, V as VerificationMethod, by as isRefundPendingApproval } from './types-CT0Ksonp.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.
|
|
9
|
+
declare const SDK_VERSION = "3.12.0";
|
|
10
10
|
|
|
11
11
|
interface VerifyWebhookOptions {
|
|
12
12
|
/** Max age of the signed timestamp, in seconds. Default 300 (5 min). */
|
|
@@ -584,7 +584,10 @@ declare class PlatformCommerceServer {
|
|
|
584
584
|
* Send the buyer to `checkoutUrl` — INVO's hosted page owns the card form, wallets,
|
|
585
585
|
* billing address, and 3-D Secure (there is NO billing address in this request, and no
|
|
586
586
|
* client payment code to write; optionally embed via
|
|
587
|
-
* `InvoClient.platformCommerce.mountCheckout`). `totalPrice` is USD
|
|
587
|
+
* `InvoClient.platformCommerce.mountCheckout`). `totalPrice` is USD, at least $0.50;
|
|
588
|
+
* the maximum is an INVO setting ($100,000.00 by default) and is enforced on the
|
|
589
|
+
* request, not here, so read the live figure off `ABOVE_CARD_MAXIMUM` rather than
|
|
590
|
+
* pinning one.
|
|
588
591
|
* The sale is real only on the `platform_commerce.purchased` webhook — never on the
|
|
589
592
|
* client return.
|
|
590
593
|
*
|
package/dist/server.d.ts
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 ConfirmPaymentResult, ap as OrderDetailsResult, aq as SteamPacksQuery, ar as SteamPacksResult, as as SteamInitPurchaseInput, at as SteamInitPurchaseResult, au as SteamFinalizeInput, av as SteamFinalizeResult, aw as PurchaseItemInput, ax as PurchaseItemResult, ay as ItemHistoryQuery, az as ItemHistoryResult, aA as ItemOrderQuery, aB as PlayerBalanceQuery, aC as PlayerBalanceResult, aD as InboundPendingQuery, aE as InboundPendingResult, aF as LinkedIdentitiesQuery, aG as LinkedIdentitiesResult, aH as SmsVerifyResult, aI as ClaimTransferInput, aJ as ClaimResult, aK as ClaimCurrencyInput, aL as TransactionStatusResult, aM as GuardianApprovalStatusResult, aN as ServerDestinationsQuery, k as DestinationsResult, aO as PhoneShareContact, aP as PhoneShareInitiateResult, aQ as PhoneShareApproveInput, aR as PhoneShareApproveResult, aS as PhoneShareStatusResult, aT as BeginDeviceApprovalInput, aU as DeviceApprovalGrant, aV as PollDeviceApprovalInput, aW as DeviceApprovalPollResult, aX as ConfirmDeviceEnrollmentInput, aY as ConfirmDeviceEnrollmentResult, aZ as ApproveWithDeviceCodeInput, a_ as DeviceApprovalSettleResult, a$ as CompleteDeviceApprovalInput, b0 as CompleteDeviceApprovalResult } from './types-
|
|
2
|
-
export { b1 as CardSetupStatus, b2 as CurrencyBalance, p as DestinationGame, b3 as DeviceApprovalChannel, b4 as DeviceApprovalEnrollment, b5 as DeviceApprovalFlow, b6 as DeviceApprovalPollStatus, b7 as DeviceEnrollmentDecision, b8 as DeviceEnrollmentRespond, b9 as FirstCharge, ba as FirstChargeStatus, bb as FundingSource, bc as InboundPendingItem, q as InvoErrorInfo, r as InvoHooks, s as InvoRequestInfo, t as InvoResponseInfo, bd as LinkedIdentityEmail, be as PlatformPurchaseStatus, w as Rail, bf as RefundInitiation, bg as RefundPendingApproval, bh as RefundProcessingFeeBasis, bi as RefundReceipt, bj as RefundRevenueShareAttribution, bk as RefundWarning, bl as SandboxClockState, bm as SavedCard, bn as SteamPack, bo as SteamUserSession, bp as Subscription, bq as SubscriptionBaseInput, br as SubscriptionConsent, bs as SubscriptionConsentInput, bt as SubscriptionFundingRail, bu as SubscriptionInterval, bv as SubscriptionRevenueShare, bw as SubscriptionRevenueShareInput, bx as SubscriptionStatus, V as VerificationMethod, by as isRefundPendingApproval } from './types-
|
|
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 ConfirmPaymentResult, ap as OrderDetailsResult, aq as SteamPacksQuery, ar as SteamPacksResult, as as SteamInitPurchaseInput, at as SteamInitPurchaseResult, au as SteamFinalizeInput, av as SteamFinalizeResult, aw as PurchaseItemInput, ax as PurchaseItemResult, ay as ItemHistoryQuery, az as ItemHistoryResult, aA as ItemOrderQuery, aB as PlayerBalanceQuery, aC as PlayerBalanceResult, aD as InboundPendingQuery, aE as InboundPendingResult, aF as LinkedIdentitiesQuery, aG as LinkedIdentitiesResult, aH as SmsVerifyResult, aI as ClaimTransferInput, aJ as ClaimResult, aK as ClaimCurrencyInput, aL as TransactionStatusResult, aM as GuardianApprovalStatusResult, aN as ServerDestinationsQuery, k as DestinationsResult, aO as PhoneShareContact, aP as PhoneShareInitiateResult, aQ as PhoneShareApproveInput, aR as PhoneShareApproveResult, aS as PhoneShareStatusResult, aT as BeginDeviceApprovalInput, aU as DeviceApprovalGrant, aV as PollDeviceApprovalInput, aW as DeviceApprovalPollResult, aX as ConfirmDeviceEnrollmentInput, aY as ConfirmDeviceEnrollmentResult, aZ as ApproveWithDeviceCodeInput, a_ as DeviceApprovalSettleResult, a$ as CompleteDeviceApprovalInput, b0 as CompleteDeviceApprovalResult } from './types-CT0Ksonp.js';
|
|
2
|
+
export { b1 as CardSetupStatus, b2 as CurrencyBalance, p as DestinationGame, b3 as DeviceApprovalChannel, b4 as DeviceApprovalEnrollment, b5 as DeviceApprovalFlow, b6 as DeviceApprovalPollStatus, b7 as DeviceEnrollmentDecision, b8 as DeviceEnrollmentRespond, b9 as FirstCharge, ba as FirstChargeStatus, bb as FundingSource, bc as InboundPendingItem, q as InvoErrorInfo, r as InvoHooks, s as InvoRequestInfo, t as InvoResponseInfo, bd as LinkedIdentityEmail, be as PlatformPurchaseStatus, w as Rail, bf as RefundInitiation, bg as RefundPendingApproval, bh as RefundProcessingFeeBasis, bi as RefundReceipt, bj as RefundRevenueShareAttribution, bk as RefundWarning, bl as SandboxClockState, bm as SavedCard, bn as SteamPack, bo as SteamUserSession, bp as Subscription, bq as SubscriptionBaseInput, br as SubscriptionConsent, bs as SubscriptionConsentInput, bt as SubscriptionFundingRail, bu as SubscriptionInterval, bv as SubscriptionRevenueShare, bw as SubscriptionRevenueShareInput, bx as SubscriptionStatus, V as VerificationMethod, by as isRefundPendingApproval } from './types-CT0Ksonp.js';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* The package version, as sent in the server User-Agent. A test pins this to
|
|
6
6
|
* `package.json` so it cannot drift silently (it did: the UA read 3.0.0 through 3.7.0).
|
|
7
7
|
* Bump it with the changeset flow.
|
|
8
8
|
*/
|
|
9
|
-
declare const SDK_VERSION = "3.
|
|
9
|
+
declare const SDK_VERSION = "3.12.0";
|
|
10
10
|
|
|
11
11
|
interface VerifyWebhookOptions {
|
|
12
12
|
/** Max age of the signed timestamp, in seconds. Default 300 (5 min). */
|
|
@@ -584,7 +584,10 @@ declare class PlatformCommerceServer {
|
|
|
584
584
|
* Send the buyer to `checkoutUrl` — INVO's hosted page owns the card form, wallets,
|
|
585
585
|
* billing address, and 3-D Secure (there is NO billing address in this request, and no
|
|
586
586
|
* client payment code to write; optionally embed via
|
|
587
|
-
* `InvoClient.platformCommerce.mountCheckout`). `totalPrice` is USD
|
|
587
|
+
* `InvoClient.platformCommerce.mountCheckout`). `totalPrice` is USD, at least $0.50;
|
|
588
|
+
* the maximum is an INVO setting ($100,000.00 by default) and is enforced on the
|
|
589
|
+
* request, not here, so read the live figure off `ABOVE_CARD_MAXIMUM` rather than
|
|
590
|
+
* pinning one.
|
|
588
591
|
* The sale is real only on the `platform_commerce.purchased` webhook — never on the
|
|
589
592
|
* client return.
|
|
590
593
|
*
|
package/dist/server.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { InvoError, assertSecureBaseUrl, Http, toDestinationsResult } from './chunk-
|
|
2
|
-
export { InvoError } from './chunk-
|
|
1
|
+
import { InvoError, assertSecureBaseUrl, Http, toDestinationsResult } from './chunk-5BMM5ZTW.js';
|
|
2
|
+
export { InvoError } from './chunk-5BMM5ZTW.js';
|
|
3
3
|
import { createHmac, timingSafeEqual } from 'crypto';
|
|
4
4
|
|
|
5
5
|
// src/version.ts
|
|
6
|
-
var SDK_VERSION = "3.
|
|
6
|
+
var SDK_VERSION = "3.12.0";
|
|
7
7
|
|
|
8
8
|
// src/shared/types.ts
|
|
9
9
|
function isRefundPendingApproval(r) {
|
|
@@ -175,7 +175,7 @@ async function hmacHexSubtle(secret, message) {
|
|
|
175
175
|
|
|
176
176
|
// src/server.ts
|
|
177
177
|
var DEFAULT_UA = `invonetwork-web-sdk/${SDK_VERSION} (+https://invo.network)`;
|
|
178
|
-
var MAX_USD_AMOUNT =
|
|
178
|
+
var MAX_USD_AMOUNT = 999999.99;
|
|
179
179
|
var MAX_ITEM_PRICE = 999999.99;
|
|
180
180
|
function invalidInput(label, value, why) {
|
|
181
181
|
return new InvoError({
|
|
@@ -477,7 +477,6 @@ function requireField(value, field, raw) {
|
|
|
477
477
|
}
|
|
478
478
|
var FUNDING_SOURCES = /* @__PURE__ */ new Set(["balance", "card"]);
|
|
479
479
|
var CARD_MIN_USD = 0.5;
|
|
480
|
-
var CARD_MAX_USD = 999.99;
|
|
481
480
|
var PlatformCommerceServer = class {
|
|
482
481
|
constructor(http, auth) {
|
|
483
482
|
this.http = http;
|
|
@@ -494,7 +493,10 @@ var PlatformCommerceServer = class {
|
|
|
494
493
|
* Send the buyer to `checkoutUrl` — INVO's hosted page owns the card form, wallets,
|
|
495
494
|
* billing address, and 3-D Secure (there is NO billing address in this request, and no
|
|
496
495
|
* client payment code to write; optionally embed via
|
|
497
|
-
* `InvoClient.platformCommerce.mountCheckout`). `totalPrice` is USD
|
|
496
|
+
* `InvoClient.platformCommerce.mountCheckout`). `totalPrice` is USD, at least $0.50;
|
|
497
|
+
* the maximum is an INVO setting ($100,000.00 by default) and is enforced on the
|
|
498
|
+
* request, not here, so read the live figure off `ABOVE_CARD_MAXIMUM` rather than
|
|
499
|
+
* pinning one.
|
|
498
500
|
* The sale is real only on the `platform_commerce.purchased` webhook — never on the
|
|
499
501
|
* client return.
|
|
500
502
|
*
|
|
@@ -540,13 +542,6 @@ var PlatformCommerceServer = class {
|
|
|
540
542
|
status: 0
|
|
541
543
|
});
|
|
542
544
|
}
|
|
543
|
-
if (total > CARD_MAX_USD) {
|
|
544
|
-
throw new InvoError({
|
|
545
|
-
message: `Card purchases must be $${CARD_MAX_USD} or less.`,
|
|
546
|
-
code: "ABOVE_CARD_MAXIMUM",
|
|
547
|
-
status: 0
|
|
548
|
-
});
|
|
549
|
-
}
|
|
550
545
|
}
|
|
551
546
|
if (input.playerPhone !== void 0) assertE164(input.playerPhone, "playerPhone");
|
|
552
547
|
const body = {
|
|
@@ -296,8 +296,15 @@ declare class InvoError extends Error {
|
|
|
296
296
|
/** True if a Platform Commerce CARD purchase was below the processor's floor of $0.50
|
|
297
297
|
* (backend code `BELOW_STRIPE_MINIMUM`, 400). Neutral name; matches the wire code. */
|
|
298
298
|
get isBelowCardMinimum(): boolean;
|
|
299
|
-
/** True if a
|
|
300
|
-
*
|
|
299
|
+
/** True if a CARD purchase exceeded INVO's maximum single card charge
|
|
300
|
+
* (`ABOVE_CARD_MAXIMUM`, 400) — split the sale or lower the amount. Do not retry it
|
|
301
|
+
* unchanged; nothing was charged.
|
|
302
|
+
*
|
|
303
|
+
* The cap is a runtime setting ($100,000.00 by default since 2026-09-18), editable by
|
|
304
|
+
* an INVO admin without a deploy and different per environment, so this SDK does not
|
|
305
|
+
* pin it and never raises this error locally. `err.message` carries the figure that was
|
|
306
|
+
* in force for the request that failed; the live figure for a tenant is also the
|
|
307
|
+
* `max_amount` of the hosted checkout's `validate-game` read. */
|
|
301
308
|
get isAboveCardMaximum(): boolean;
|
|
302
309
|
/**
|
|
303
310
|
* True if a Platform Commerce refund targeted an order that was already refunded
|
|
@@ -722,6 +729,10 @@ interface InitiateResult {
|
|
|
722
729
|
}
|
|
723
730
|
interface CreateCheckoutInput {
|
|
724
731
|
playerEmail: string;
|
|
732
|
+
/** USD, two decimals. The advertised minimum is $0.50 (the card rail's own floor).
|
|
733
|
+
* The maximum is an INVO runtime setting, $100,000.00 by default, editable by an
|
|
734
|
+
* admin and different per environment, so it is enforced on the request rather than
|
|
735
|
+
* pinned here: expect a 400 carrying the live figure. */
|
|
725
736
|
usdAmount: string | number;
|
|
726
737
|
/** Which rail the hosted page presents. Default "platform" (card). The page
|
|
727
738
|
* renders the right experience per rail — all branded as INVO. */
|
|
@@ -751,6 +762,10 @@ interface CreateCheckoutResult {
|
|
|
751
762
|
}
|
|
752
763
|
interface PurchaseInput {
|
|
753
764
|
playerEmail: string;
|
|
765
|
+
/** USD, two decimals. The advertised minimum is $0.50 (the card rail's own floor).
|
|
766
|
+
* The maximum is an INVO runtime setting, $100,000.00 by default, editable by an
|
|
767
|
+
* admin and different per environment, so it is enforced on the request rather than
|
|
768
|
+
* pinned here: expect a 400 carrying the live figure. */
|
|
754
769
|
usdAmount: string | number;
|
|
755
770
|
/** Idempotency key. Required. */
|
|
756
771
|
purchaseReference: string;
|
|
@@ -961,8 +976,9 @@ interface PlatformPurchaseInput {
|
|
|
961
976
|
/** Price PER UNIT. > 0. On the CARD leg this is USD; on the BALANCE leg it is the
|
|
962
977
|
* tenant's network-currency amount. */
|
|
963
978
|
unitPrice: string | number;
|
|
964
|
-
/** Must equal unitPrice × itemQuantity (±0.01). USD on the card leg (
|
|
965
|
-
*
|
|
979
|
+
/** Must equal unitPrice × itemQuantity (±0.01). USD on the card leg (at least $0.50;
|
|
980
|
+
* the maximum is an INVO setting, $100,000.00 by default, enforced on the request);
|
|
981
|
+
* network currency on the balance leg. */
|
|
966
982
|
totalPrice: string | number;
|
|
967
983
|
playerPhone?: string;
|
|
968
984
|
itemDescription?: string;
|
|
@@ -296,8 +296,15 @@ declare class InvoError extends Error {
|
|
|
296
296
|
/** True if a Platform Commerce CARD purchase was below the processor's floor of $0.50
|
|
297
297
|
* (backend code `BELOW_STRIPE_MINIMUM`, 400). Neutral name; matches the wire code. */
|
|
298
298
|
get isBelowCardMinimum(): boolean;
|
|
299
|
-
/** True if a
|
|
300
|
-
*
|
|
299
|
+
/** True if a CARD purchase exceeded INVO's maximum single card charge
|
|
300
|
+
* (`ABOVE_CARD_MAXIMUM`, 400) — split the sale or lower the amount. Do not retry it
|
|
301
|
+
* unchanged; nothing was charged.
|
|
302
|
+
*
|
|
303
|
+
* The cap is a runtime setting ($100,000.00 by default since 2026-09-18), editable by
|
|
304
|
+
* an INVO admin without a deploy and different per environment, so this SDK does not
|
|
305
|
+
* pin it and never raises this error locally. `err.message` carries the figure that was
|
|
306
|
+
* in force for the request that failed; the live figure for a tenant is also the
|
|
307
|
+
* `max_amount` of the hosted checkout's `validate-game` read. */
|
|
301
308
|
get isAboveCardMaximum(): boolean;
|
|
302
309
|
/**
|
|
303
310
|
* True if a Platform Commerce refund targeted an order that was already refunded
|
|
@@ -722,6 +729,10 @@ interface InitiateResult {
|
|
|
722
729
|
}
|
|
723
730
|
interface CreateCheckoutInput {
|
|
724
731
|
playerEmail: string;
|
|
732
|
+
/** USD, two decimals. The advertised minimum is $0.50 (the card rail's own floor).
|
|
733
|
+
* The maximum is an INVO runtime setting, $100,000.00 by default, editable by an
|
|
734
|
+
* admin and different per environment, so it is enforced on the request rather than
|
|
735
|
+
* pinned here: expect a 400 carrying the live figure. */
|
|
725
736
|
usdAmount: string | number;
|
|
726
737
|
/** Which rail the hosted page presents. Default "platform" (card). The page
|
|
727
738
|
* renders the right experience per rail — all branded as INVO. */
|
|
@@ -751,6 +762,10 @@ interface CreateCheckoutResult {
|
|
|
751
762
|
}
|
|
752
763
|
interface PurchaseInput {
|
|
753
764
|
playerEmail: string;
|
|
765
|
+
/** USD, two decimals. The advertised minimum is $0.50 (the card rail's own floor).
|
|
766
|
+
* The maximum is an INVO runtime setting, $100,000.00 by default, editable by an
|
|
767
|
+
* admin and different per environment, so it is enforced on the request rather than
|
|
768
|
+
* pinned here: expect a 400 carrying the live figure. */
|
|
754
769
|
usdAmount: string | number;
|
|
755
770
|
/** Idempotency key. Required. */
|
|
756
771
|
purchaseReference: string;
|
|
@@ -961,8 +976,9 @@ interface PlatformPurchaseInput {
|
|
|
961
976
|
/** Price PER UNIT. > 0. On the CARD leg this is USD; on the BALANCE leg it is the
|
|
962
977
|
* tenant's network-currency amount. */
|
|
963
978
|
unitPrice: string | number;
|
|
964
|
-
/** Must equal unitPrice × itemQuantity (±0.01). USD on the card leg (
|
|
965
|
-
*
|
|
979
|
+
/** Must equal unitPrice × itemQuantity (±0.01). USD on the card leg (at least $0.50;
|
|
980
|
+
* the maximum is an INVO setting, $100,000.00 by default, enforced on the request);
|
|
981
|
+
* network currency on the balance leg. */
|
|
966
982
|
totalPrice: string | number;
|
|
967
983
|
playerPhone?: string;
|
|
968
984
|
itemDescription?: string;
|
package/package.json
CHANGED