@invonetwork/web-sdk 3.37.1 → 3.38.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 +13 -0
- package/README.md +14 -2
- package/dist/{chunk-QD5G355J.js → chunk-3HK32FE4.js} +3 -3
- package/dist/{chunk-I4GDKZFL.js → chunk-7B7MFAQ3.js} +22 -2
- package/dist/chunk-MOHWLDOQ.js +6 -0
- package/dist/{chunk-YFNQKYUI.js → chunk-NS33T5FB.js} +46 -5
- package/dist/game-server.cjs +70 -9
- package/dist/game-server.d.cts +4 -4
- package/dist/game-server.d.ts +4 -4
- package/dist/game-server.js +5 -5
- package/dist/game.cjs +21 -1
- package/dist/game.d.cts +3 -3
- package/dist/game.d.ts +3 -3
- package/dist/game.js +3 -3
- package/dist/{hosted-approval-CxWyQOfU.d.cts → hosted-approval-B-kbdFDL.d.cts} +1 -1
- package/dist/{hosted-approval-D-CGX-LO.d.ts → hosted-approval-CtAZ1Rzt.d.ts} +1 -1
- package/dist/index.cjs +20 -0
- package/dist/index.d.cts +4 -4
- package/dist/index.d.ts +4 -4
- package/dist/index.js +2 -2
- package/dist/{server-BuByP1JU.d.cts → server-BWGl9v5j.d.cts} +75 -3
- package/dist/{server-DzczMA-z.d.ts → server-CaaP-Nc3.d.ts} +75 -3
- package/dist/server.cjs +70 -9
- package/dist/server.d.cts +3 -3
- package/dist/server.d.ts +3 -3
- package/dist/server.js +3 -3
- package/dist/{types-IRNjMV47.d.cts → types-DGgWWX1v.d.cts} +65 -1
- package/dist/{types-IRNjMV47.d.ts → types-DGgWWX1v.d.ts} +65 -1
- package/dist/{version-BIHJFKuj.d.cts → version-D_cJUvMp.d.cts} +1 -1
- package/dist/{version-BIHJFKuj.d.ts → version-D_cJUvMp.d.ts} +1 -1
- package/docs/merchant-of-record-tax.md +176 -0
- package/package.json +2 -1
- package/dist/chunk-OYJUX2TH.js +0 -6
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,18 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 3.38.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- Tax on Merchant of Record sales. On the Merchant of Record tier INVO is the seller on card sales and handles the consumption tax: added on top in the US, included in the price everywhere else (the developer bears it and INVO's fee is worked out on the net). All additive; nothing changes for an integration that does not read the new fields.
|
|
8
|
+
|
|
9
|
+
- `CurrencyPurchaseQuoteBreakdown` gains `taxIncluded`, `taxIncludedUsd`, `taxAddedUsd`, `taxLabel`, `taxLine` ("Includes VAT 20% ($1.67)") and `taxPriceDisplay`, present only on a tax-inclusive sale. When `taxIncluded` is `true` the tax is inside `subtotalUsd` and `totalUsd = subtotalUsd + processingFeeUsd`.
|
|
10
|
+
- `PurchaseResult` (`purchaseCurrency()`) gains `taxIncluded`, `taxUsd`, `taxIncludedUsd`, `taxPriceDisplay`, `taxJurisdiction`, `taxRatePct`, `taxLabel` and `taxLine`, on a tax-inclusive sale only.
|
|
11
|
+
- New `TaxPriceDisplay` type (`"inclusive" | "exclusive" | string`).
|
|
12
|
+
- `InvoError.isSaleNotAvailableInCountry` (`SALE_NOT_AVAILABLE_IN_COUNTRY`, 409: the buyer is in a country where INVO does not yet sell as Merchant of Record; nothing was charged; not retryable) and `err.unavailableCountry`.
|
|
13
|
+
- Webhook types: the tax keys on `purchase.completed` (`charge_total_usd`, `subtotal_usd`, `tax_usd`, `tax_jurisdiction`, `tax_rate_pct`, `tax_price_display`, `tax_included`), `purchase.refunded` and `platform_commerce.refunded` (`tax_refunded_usd`, `tax_jurisdiction`, `tax_included`, `tax_price_display`), `platform_commerce.purchased` (`item_price_usd`, `tax_usd`, `tax_jurisdiction`, `tax_price_display`, `tax_included`, `tax_rate_pct`; `fee_breakdown.tax_set_aside_usd` documented) and `subscription.renewed` `funding` (`tax_usd`, `card_authorised_usd`, `tax_jurisdiction`, `tax_included_usd`, `tax_included`, `tax_price_display`, `tax_rate_pct`).
|
|
14
|
+
- New guide, docs/merchant-of-record-tax.md (shipped in the package and linked from the README): the worked $10 UK example, tax set aside while a registration is pending, refunds, the error and what to show buyers, and the console tax rows.
|
|
15
|
+
|
|
3
16
|
## 3.37.1
|
|
4
17
|
|
|
5
18
|
### Patch Changes
|
package/README.md
CHANGED
|
@@ -6,6 +6,8 @@ First-party TypeScript SDK for integrating **INVO** into partner **web** platfor
|
|
|
6
6
|
> Canonical partner reference: **https://docs.invo.network/docs/currency-purchase** and **https://docs.invo.network/docs/game-developer-integration**.
|
|
7
7
|
> **Selling on iOS?** Read the full guide: [Apple In-App Purchases (StoreKit 2)](https://github.com/Invo-Technologies/invo-web-sdk/blob/main/docs/apple-in-app-purchases.md).
|
|
8
8
|
|
|
9
|
+
> **On the Merchant of Record tier?** Read the full guide: [Tax on Merchant of Record sales](https://github.com/Invo-Technologies/invo-web-sdk/blob/main/docs/merchant-of-record-tax.md) (3.38.0): tax-inclusive prices outside the US (`taxIncluded`, `taxLine`), who bears the VAT, tax set aside while a registration is pending, and `err.isSaleNotAvailableInCountry`.
|
|
10
|
+
|
|
9
11
|
## What it does
|
|
10
12
|
|
|
11
13
|
Six money flows plus passkey (WebAuthn) authentication, split across a trusted server entry and an untrusted browser entry:
|
|
@@ -99,6 +101,7 @@ The right approval method is a property of the **client the player is sitting in
|
|
|
99
101
|
- [Before you go live](#before-you-go-live)
|
|
100
102
|
- [Configuration](#configuration)
|
|
101
103
|
- [Tiers](#tiers)
|
|
104
|
+
- [Tax on Merchant of Record sales](#tax-on-merchant-of-record-sales): full guide in [docs/merchant-of-record-tax.md](https://github.com/Invo-Technologies/invo-web-sdk/blob/main/docs/merchant-of-record-tax.md)
|
|
102
105
|
- [Currency purchase (real money in)](#currency-purchase-real-money-in)
|
|
103
106
|
- [The card maximum is INVO's, not the SDK's](#the-card-maximum-is-invos-not-the-sdks)
|
|
104
107
|
- [INVO's card fee: quote, show, acknowledge](#invos-card-fee-quote-show-acknowledge)
|
|
@@ -548,6 +551,14 @@ The card terms above (card fee, international fee, minimum and chargeback guaran
|
|
|
548
551
|
- **Receipts (Merchant of Record only).** INVO issues a receipt for every card sale and a refund receipt for every card refund, and emails it to the buyer when the buyer's email is known; the number is always issued (a pending refund's number follows once it settles) and always reaches you. The number and link reach you as `receiptNumber` / `receiptUrl` on `purchaseCurrency()`, `getOrderDetails()` (from `GET /order-details`, which returns `receipt_number` / `receipt_url`), `CheckoutClient.getPurchaseStatus()` (once `credited`), `platformCommerce.getStatus()` and a paid `firstCharge`, and as `receipt_number` / `receipt_url` on the `purchase.completed`, `platform_commerce.purchased` and `subscription.renewed` webhooks. The refund webhooks (`purchase.refunded`, `platform_commerce.refunded`, `subscription.refunded`) carry the refund receipt's. On Open, and on storefront rails, the fields are absent. Anyone with a `receiptUrl` can read the receipt.
|
|
549
552
|
- **Chargeback reserve (Merchant of Record only).** Part of your share of each card-funded sale (Platform Commerce card sales, card subscription charges) is held, by default 10% for 90 days (terms may differ per account), then released automatically. It affects your withdrawable balance, not anything this SDK returns: see https://docs.invo.network/docs/tiers/ for the balance fields.
|
|
550
553
|
|
|
554
|
+
### Tax on Merchant of Record sales
|
|
555
|
+
|
|
556
|
+
On Merchant of Record INVO is the seller on your card sales and handles the consumption tax. In the US tax is added on top of your price. **Outside the US your price includes the tax**: the buyer pays $10.00 and sees "Includes VAT 20% ($1.67)", the tax comes out of the price, and INVO's fee and your share are worked out on the net ($10.00 UK sale: $1.67 VAT, $8.33 net, $0.57 fee, $7.76 to you). Where INVO's registration is still pending the buyer sees no tax line but the tax is still set aside from your share. A buyer in a country not yet open to Merchant of Record sales (today the EU, until January 1, 2027) is refused before any charge with `409 SALE_NOT_AVAILABLE_IN_COUNTRY` (`err.isSaleNotAvailableInCountry`, `err.unavailableCountry`).
|
|
557
|
+
|
|
558
|
+
New in 3.38.0, all additive and present only on a tax-inclusive sale: `taxIncluded`, `taxIncludedUsd`, `taxAddedUsd`, `taxLabel`, `taxLine` and `taxPriceDisplay` on `quoteCurrencyPurchase().breakdown`; `taxIncluded`, `taxUsd`, `taxIncludedUsd`, `taxPriceDisplay`, `taxJurisdiction`, `taxRatePct`, `taxLabel` and `taxLine` on `purchaseCurrency()`; and the tax keys on `purchase.completed`, `purchase.refunded`, `platform_commerce.*` and `subscription.renewed` (`funding.tax_included_usd`). When `taxIncluded` is `true`, never add the tax to the price: show `totalUsd` and `taxLine` under it.
|
|
559
|
+
|
|
560
|
+
**Full guide: [Tax on Merchant of Record sales](https://github.com/Invo-Technologies/invo-web-sdk/blob/main/docs/merchant-of-record-tax.md)**, with the worked example, every field, the error and the console tax rows. Public docs: https://docs.invo.network/docs/merchant-of-record-tax
|
|
561
|
+
|
|
551
562
|
## Currency purchase (real money in)
|
|
552
563
|
|
|
553
564
|
Buy game currency with real money. Authenticated by the **payment rail**, not a passkey — there's no WebAuthn step. Two paths:
|
|
@@ -1024,6 +1035,7 @@ const purchase = await server.purchaseCurrency({
|
|
|
1024
1035
|
| `409 QUOTE_STALE` (`err.isQuoteStale`) | the acknowledged total is below the total INVO would charge now | nothing was charged; quote again, show `err.expectedTotalUsd`, retry with the new total and a new `purchaseReference` |
|
|
1025
1036
|
| `400 BELOW_CARD_MINIMUM` (`err.isBelowCardMinimum`) | from 2026-10-27, a card purchase under the minimum card purchase (`err.minUsd`, `err.enforcedFrom`) | nothing was charged; raise the amount to at least `err.minUsd` |
|
|
1026
1037
|
| `409 TAX_PLACE_UNAVAILABLE` (`err.isTaxPlaceUnavailable`) | Merchant of Record only: you acknowledged a taxed total, INVO could not read the buyer's tax location from the card, and the request carried no `country` | nothing was charged; retry (a new attempt usually reads the card), or send the `country` / `subdivision` you quoted with. `err.untaxedTotalUsd` is the total without tax |
|
|
1038
|
+
| `409 SALE_NOT_AVAILABLE_IN_COUNTRY` (`err.isSaleNotAvailableInCountry`) | Merchant of Record only: the buyer is in a country where INVO does not yet sell as Merchant of Record (`err.unavailableCountry`); also thrown by `quoteCurrencyPurchase()` | nothing was charged; show `err.message`, do not retry and do not ask for another card. See [Tax on Merchant of Record sales](#tax-on-merchant-of-record-sales) |
|
|
1027
1039
|
| `400 AMOUNT_BELOW_FEE` (`err.isAmountBelowFee`, deprecated) | no longer returned: the card fee is not in the player's charge | keep the branch if you have one; it will not fire |
|
|
1028
1040
|
|
|
1029
1041
|
Only a `success` response carries the fee fields (`processingFeeUsd`, `feeTakenFrom`, `partnerFeeUsd`, `internationalCardFeeUsd`); `requires_action` and `pending_payment` do not. `internationalCardFeeUsd` is `"0.00"` on a US card and on a card whose country cannot be determined (it counts as domestic). `partnerFeeUsd` and `internationalCardFeeUsd` are `null` only if the fee could not be booked when the purchase completed: the purchase succeeded and INVO books the fee shortly after. On a quote `internationalCardFeeUsd` is always `null`, since no card is known yet. Each field is exactly what INVO sent, or `undefined`: the SDK never fills one in. A purchase settled under the earlier pricing may read `feeTakenFrom: "charge"` or `"coins"`. Storefront rails bill no INVO card fee: the storefront takes its own cut.
|
|
@@ -2944,7 +2956,7 @@ export const POST = createWebhookHandler({
|
|
|
2944
2956
|
| `player.phone_changed` | a player's phone changed (confirmed by the player, or by INVO support); sent to every game the player is in | store the new `identity_id` and re-mint the token (`player_email, previous_phone_masked, new_phone_masked, new_phone_included, changed_at, source, identity_id, previous_identity_id`; `new_phone` only for the game that requested the change). Never push your stored number back; ask the player. See [Player-confirmed phone change](#player-confirmed-phone-change) |
|
|
2945
2957
|
| `payout.status_changed` | a payout of your balance to your bank | track the payout (`payout_id, status, previous_status, requested_amount_usd`, plus the payout fee: `offboarding_fee_pct, offboarding_fee_usd, offboarding_fee_cap_usd, net_payout_usd`, `null` on a payout recorded before the fee existed) |
|
|
2946
2958
|
|
|
2947
|
-
On a Merchant of Record account, `purchase.completed`, `platform_commerce.purchased` and `subscription.renewed` for a card sale also carry `receipt_number` and `receipt_url` (the receipt INVO issued to the buyer), and `purchase.refunded`, `platform_commerce.refunded` and `subscription.refunded` carry the refund receipt's. Absent on Open. `purchase.completed` also carries `tax_treatment` (`"partner_responsible"` on Open).
|
|
2959
|
+
On a Merchant of Record account, `purchase.completed`, `platform_commerce.purchased` and `subscription.renewed` for a card sale also carry `receipt_number` and `receipt_url` (the receipt INVO issued to the buyer), and `purchase.refunded`, `platform_commerce.refunded` and `subscription.refunded` carry the refund receipt's. Absent on Open. `purchase.completed` also carries `tax_treatment` (`"partner_responsible"` on Open). On a Merchant of Record sale whose price includes the tax (outside the US), the purchase, refund and `platform_commerce.*` events add `tax_included` and `tax_price_display`, and `subscription.renewed` adds `funding.tax_included_usd`: see [Tax on Merchant of Record sales](#tax-on-merchant-of-record-sales).
|
|
2948
2960
|
|
|
2949
2961
|
Don't block waiting on `purchase.failed` for the `game`/`steam` rails — they only emit `completed`/`refunded`. Reconcile off `*.completed` + the status endpoints. For Platform Commerce **card** orders, fulfill on `platform_commerce.purchased`, not the browser confirmation.
|
|
2950
2962
|
|
|
@@ -3077,7 +3089,7 @@ try {
|
|
|
3077
3089
|
| `initiateTransfer(input)` | same as `initiateSend` |
|
|
3078
3090
|
| `createCheckout(input)` | `{ sessionId, checkoutUrl, sessionToken?, expiresAt, expiresInSeconds, warnings?, minPurchaseWarning?, raw }` (`minPurchaseWarning` while an amount under INVO's minimum card purchase is still accepted), where `sessionToken` is INVO's own `session_token` field (falling back to the `checkoutUrl` query string on a backend that predates it) and is the credential for the [status read](#did-the-purchase-go-through-the-status-read) |
|
|
3079
3091
|
| `quoteCurrencyPurchase({ playerEmail, usdAmount, country?, subdivision? })` | `CurrencyPurchaseQuote`: `{ totalUsd, amountCents, subtotalUsd, processingFeeUsd, partnerFeeUsd?, internationalCardFeeUsd?, feeTakenFrom?, minPurchaseWarning?, coins, currencyName, breakdown, ifUnacknowledged, raw }`; moves no money; send `totalUsd` back as `acknowledgedTotalUsd` (see [INVO's card fee](#invos-card-fee-quote-show-acknowledge)) |
|
|
3080
|
-
| `purchaseCurrency(input)` | `{ status, clientSecret?, paymentIntentId?, paymentUrl?, transactionId?, orderId?, newBalance?, processingFeeUsd?, feeTakenFrom?, partnerFeeUsd?, internationalCardFeeUsd?, minPurchaseWarning?, coinsCredited?, chargeTotalUsd?, receiptNumber?, receiptUrl?, raw }`; optional `acknowledgedTotalUsd`, `country` and `subdivision` inputs; `receiptNumber` / `receiptUrl` on Merchant of Record only |
|
|
3092
|
+
| `purchaseCurrency(input)` | `{ status, clientSecret?, paymentIntentId?, paymentUrl?, transactionId?, orderId?, newBalance?, processingFeeUsd?, feeTakenFrom?, partnerFeeUsd?, internationalCardFeeUsd?, minPurchaseWarning?, coinsCredited?, chargeTotalUsd?, receiptNumber?, receiptUrl?, taxIncluded?, taxUsd?, taxIncludedUsd?, taxPriceDisplay?, taxJurisdiction?, taxRatePct?, taxLabel?, taxLine?, raw }`; optional `acknowledgedTotalUsd`, `country` and `subdivision` inputs; `receiptNumber` / `receiptUrl` on Merchant of Record only; the `tax*` fields on a Merchant of Record tax-inclusive sale only |
|
|
3081
3093
|
| `confirmPayment({ paymentIntentId, orderId? })` | `{ status, transactionId?, newBalance?, credited?, reasonCode?, raw }`; report success only on `credited: true` |
|
|
3082
3094
|
| `getOrderDetails({ orderId? \| transactionId? })` | `{ order, financialSummary, statusTimeline, receiptNumber?, receiptUrl?, raw }`; the receipt fields on a Merchant of Record currency purchase only |
|
|
3083
3095
|
| `appleProducts()` | `{ bundleId, canSell, unavailableReason, products: [{ productId, coins, label, priceUsd, active, available, unavailableReason }], raw }`; call before every Apple purchase and offer only `available` products. See [Apple In-App Purchases](#apple-in-app-purchases-storekit-2) |
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { InvoError, assertSecureBaseUrl, Http, toPurchaseStatusResult, toPhoneChangeApprovalsResult, phoneChangeSignalMessage, toApprovePhoneChangeResult, toDestinationsResult, toLoyaltyCardsResult, toLoyaltyVaultResult, toRedeemRewardResult, toRewardsPageLink, buildGameEventBody, toReportGameEventResult } from './chunk-
|
|
1
|
+
import { InvoError, assertSecureBaseUrl, Http, toPurchaseStatusResult, toPhoneChangeApprovalsResult, phoneChangeSignalMessage, toApprovePhoneChangeResult, toDestinationsResult, toLoyaltyCardsResult, toLoyaltyVaultResult, toRedeemRewardResult, toRewardsPageLink, buildGameEventBody, toReportGameEventResult } from './chunk-7B7MFAQ3.js';
|
|
2
2
|
|
|
3
3
|
// src/shared/webauthn.ts
|
|
4
4
|
function malformedOptions(field) {
|
|
@@ -1586,5 +1586,5 @@ var InvoClient = class {
|
|
|
1586
1586
|
};
|
|
1587
1587
|
|
|
1588
1588
|
export { CheckoutClient, InvoClient, PlatformCommerceClient };
|
|
1589
|
-
//# sourceMappingURL=chunk-
|
|
1590
|
-
//# sourceMappingURL=chunk-
|
|
1589
|
+
//# sourceMappingURL=chunk-3HK32FE4.js.map
|
|
1590
|
+
//# sourceMappingURL=chunk-3HK32FE4.js.map
|
|
@@ -543,6 +543,26 @@ var InvoError = class _InvoError extends Error {
|
|
|
543
543
|
const v = this.bodyObject()["untaxed_total_usd"];
|
|
544
544
|
return typeof v === "string" && v ? v : void 0;
|
|
545
545
|
}
|
|
546
|
+
/**
|
|
547
|
+
* Additive (3.38.0). True when a Merchant of Record card sale was refused because the buyer is in
|
|
548
|
+
* a country where INVO does not yet sell as Merchant of Record (`SALE_NOT_AVAILABLE_IN_COUNTRY`,
|
|
549
|
+
* 409; today the EU member states until January 1, 2027). NOTHING WAS CHARGED. The body carries
|
|
550
|
+
* `retryable: false`: do not retry, and do not ask for another card (the refusal follows where
|
|
551
|
+
* the buyer is). Show the message (`err.message`), for example "Purchases aren't available in
|
|
552
|
+
* your country yet. Nothing was charged." Returned by the quote, the purchase, hosted checkout
|
|
553
|
+
* and Platform Commerce card purchases. Branch on this, never on a country list.
|
|
554
|
+
* See https://docs.invo.network/docs/merchant-of-record-tax#sale-not-available
|
|
555
|
+
*/
|
|
556
|
+
get isSaleNotAvailableInCountry() {
|
|
557
|
+
return this.code === "SALE_NOT_AVAILABLE_IN_COUNTRY";
|
|
558
|
+
}
|
|
559
|
+
/** On `SALE_NOT_AVAILABLE_IN_COUNTRY`: the buyer's country, ISO 3166-1 alpha-2 (`country`), or
|
|
560
|
+
* `undefined` when INVO did not know it. */
|
|
561
|
+
get unavailableCountry() {
|
|
562
|
+
if (!this.isSaleNotAvailableInCountry) return void 0;
|
|
563
|
+
const v = this.bodyObject()["country"];
|
|
564
|
+
return typeof v === "string" && v ? v : void 0;
|
|
565
|
+
}
|
|
546
566
|
/**
|
|
547
567
|
* True if a Platform Commerce refund targeted an order that was already refunded
|
|
548
568
|
* (409). Idempotent outcome — the original refund did happen, so treat this as
|
|
@@ -1905,5 +1925,5 @@ function toApprovePhoneChangeResult(raw, changeRequestId) {
|
|
|
1905
1925
|
}
|
|
1906
1926
|
|
|
1907
1927
|
export { Http, InvoError, assertSecureBaseUrl, buildGameEventBody, creditFields, isPurchaseCredited, isPurchaseExpired, isPurchaseRefunded, isPurchaseRefused, newEventId, nothingWasCharged, phoneChangeSignalMessage, receiptFields, toApprovePhoneChangeResult, toDestinationsResult, toLoyaltyCardsResult, toLoyaltyVaultResult, toPhoneChangeApprovalsResult, toPhoneChangeRequest, toPurchaseStatusResult, toRedeemRewardResult, toReportGameEventResult, toRequestPhoneChangeResult, toRewardsPageLink };
|
|
1908
|
-
//# sourceMappingURL=chunk-
|
|
1909
|
-
//# sourceMappingURL=chunk-
|
|
1928
|
+
//# sourceMappingURL=chunk-7B7MFAQ3.js.map
|
|
1929
|
+
//# sourceMappingURL=chunk-7B7MFAQ3.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { SDK_VERSION } from './chunk-
|
|
2
|
-
import { InvoError, assertSecureBaseUrl, Http, toRequestPhoneChangeResult, toPhoneChangeRequest, toPurchaseStatusResult, receiptFields, creditFields, toLoyaltyCardsResult, buildGameEventBody, toReportGameEventResult, toDestinationsResult } from './chunk-
|
|
1
|
+
import { SDK_VERSION } from './chunk-MOHWLDOQ.js';
|
|
2
|
+
import { InvoError, assertSecureBaseUrl, Http, toRequestPhoneChangeResult, toPhoneChangeRequest, toPurchaseStatusResult, receiptFields, creditFields, toLoyaltyCardsResult, buildGameEventBody, toReportGameEventResult, toDestinationsResult } from './chunk-7B7MFAQ3.js';
|
|
3
3
|
import { createHmac, timingSafeEqual } from 'crypto';
|
|
4
4
|
|
|
5
5
|
// src/shared/apple.ts
|
|
@@ -88,6 +88,39 @@ function toApplePurchaseResult(raw) {
|
|
|
88
88
|
};
|
|
89
89
|
}
|
|
90
90
|
|
|
91
|
+
// src/shared/tax-fields.ts
|
|
92
|
+
function str(v) {
|
|
93
|
+
return v == null ? void 0 : String(v);
|
|
94
|
+
}
|
|
95
|
+
function includedTaxFields(raw) {
|
|
96
|
+
const out = {};
|
|
97
|
+
if (typeof raw["tax_included"] === "boolean") out.taxIncluded = raw["tax_included"];
|
|
98
|
+
const inc = str(raw["tax_included_usd"]);
|
|
99
|
+
if (inc !== void 0) out.taxIncludedUsd = inc;
|
|
100
|
+
const display = str(raw["tax_price_display"]);
|
|
101
|
+
if (display !== void 0) out.taxPriceDisplay = display;
|
|
102
|
+
const label = str(raw["tax_label"]);
|
|
103
|
+
if (label !== void 0) out.taxLabel = label;
|
|
104
|
+
const line = str(raw["tax_line"]);
|
|
105
|
+
if (line !== void 0) out.taxLine = line;
|
|
106
|
+
return out;
|
|
107
|
+
}
|
|
108
|
+
function includedTaxBreakdownFields(raw) {
|
|
109
|
+
const out = includedTaxFields(raw);
|
|
110
|
+
const added = str(raw["tax_added_usd"]);
|
|
111
|
+
if (added !== void 0) out.taxAddedUsd = added;
|
|
112
|
+
return out;
|
|
113
|
+
}
|
|
114
|
+
function includedTaxPurchaseFields(raw) {
|
|
115
|
+
const out = includedTaxFields(raw);
|
|
116
|
+
if (out.taxIncluded !== true) return out;
|
|
117
|
+
const tax = str(raw["tax_usd"]);
|
|
118
|
+
if (tax !== void 0) out.taxUsd = tax;
|
|
119
|
+
if (Object.prototype.hasOwnProperty.call(raw, "tax_jurisdiction")) out.taxJurisdiction = str(raw["tax_jurisdiction"]) ?? null;
|
|
120
|
+
if (Object.prototype.hasOwnProperty.call(raw, "tax_rate_pct")) out.taxRatePct = str(raw["tax_rate_pct"]) ?? null;
|
|
121
|
+
return out;
|
|
122
|
+
}
|
|
123
|
+
|
|
91
124
|
// src/payouts.ts
|
|
92
125
|
var AMOUNT = /^\d+(\.\d{1,2})?$/;
|
|
93
126
|
function invalidInput(label, value, why) {
|
|
@@ -663,6 +696,7 @@ function toQuoteBreakdown(row) {
|
|
|
663
696
|
totalUsd: String(r["total_usd"] ?? ""),
|
|
664
697
|
coins: String(r["coins"] ?? ""),
|
|
665
698
|
currencyName: String(r["currency_name"] ?? ""),
|
|
699
|
+
...includedTaxBreakdownFields(r),
|
|
666
700
|
raw: r
|
|
667
701
|
};
|
|
668
702
|
}
|
|
@@ -2886,6 +2920,7 @@ var InvoServer = class {
|
|
|
2886
2920
|
chargeTotalUsd: optionalDecimalString(raw["charge_total_usd"]),
|
|
2887
2921
|
...pricingFields(raw),
|
|
2888
2922
|
...receiptFields(raw),
|
|
2923
|
+
...includedTaxPurchaseFields(raw),
|
|
2889
2924
|
raw
|
|
2890
2925
|
};
|
|
2891
2926
|
}
|
|
@@ -2906,8 +2941,14 @@ var InvoServer = class {
|
|
|
2906
2941
|
* accepted. Card purchases only; purchases through a third-party storefront or payment
|
|
2907
2942
|
* rail are unaffected.
|
|
2908
2943
|
*
|
|
2944
|
+
* Merchant of Record: in the US tax is added on top (`totalUsd` above the price); outside the
|
|
2945
|
+
* US the price includes the tax, and `breakdown.taxIncluded` is `true` with
|
|
2946
|
+
* `breakdown.taxLine` ("Includes VAT 20% ($1.67)") to show under `totalUsd`.
|
|
2947
|
+
*
|
|
2909
2948
|
* Refusals: `400 INVALID_INPUT` (amount missing, not above zero, or above INVO's card
|
|
2910
|
-
* maximum), `400 CURRENCY_NOT_CONFIGURED`, `503 RATE_UNAVAILABLE
|
|
2949
|
+
* maximum), `400 CURRENCY_NOT_CONFIGURED`, `503 RATE_UNAVAILABLE`, and on Merchant of Record
|
|
2950
|
+
* `409 SALE_NOT_AVAILABLE_IN_COUNTRY` (`err.isSaleNotAvailableInCountry`) for a buyer in a
|
|
2951
|
+
* country where INVO does not yet sell as Merchant of Record.
|
|
2911
2952
|
*/
|
|
2912
2953
|
async quoteCurrencyPurchase(input, opts) {
|
|
2913
2954
|
assertUsdAmount(input.usdAmount);
|
|
@@ -4126,5 +4167,5 @@ var InvoServer = class {
|
|
|
4126
4167
|
};
|
|
4127
4168
|
|
|
4128
4169
|
export { APPLE_FINISH_ERROR_CODES, CardsServer, DEMO_KEY_PREFIX, EnvironmentUnknownError, InvoServer, KeyEnvironmentMismatchError, LIVE_KEY_PREFIX, PRODUCTION_BASE_URL, PayoutsServer, PlatformCommerceServer, SANDBOX_BASE_URL, SandboxServer, SandboxSubscriptionsServer, SubscriptionsServer, TEST_KEY_PREFIX, assertKeyMatchesBaseUrl, assertKeyMatchesEnvironment, baseUrlForKey, createWebhookHandler, environmentForBaseUrl, environmentFromKeyPrefix, isAppleCreditPending, isDemoKey, isRefundPendingApproval, resolveEnvironment, shouldFinishAppleTransaction, verifyInvoSignature, verifyWebhook, verifyWebhookAsync };
|
|
4129
|
-
//# sourceMappingURL=chunk-
|
|
4130
|
-
//# sourceMappingURL=chunk-
|
|
4170
|
+
//# sourceMappingURL=chunk-NS33T5FB.js.map
|
|
4171
|
+
//# sourceMappingURL=chunk-NS33T5FB.js.map
|
package/dist/game-server.cjs
CHANGED
|
@@ -717,6 +717,26 @@ var InvoError = class _InvoError extends Error {
|
|
|
717
717
|
const v = this.bodyObject()["untaxed_total_usd"];
|
|
718
718
|
return typeof v === "string" && v ? v : void 0;
|
|
719
719
|
}
|
|
720
|
+
/**
|
|
721
|
+
* Additive (3.38.0). True when a Merchant of Record card sale was refused because the buyer is in
|
|
722
|
+
* a country where INVO does not yet sell as Merchant of Record (`SALE_NOT_AVAILABLE_IN_COUNTRY`,
|
|
723
|
+
* 409; today the EU member states until January 1, 2027). NOTHING WAS CHARGED. The body carries
|
|
724
|
+
* `retryable: false`: do not retry, and do not ask for another card (the refusal follows where
|
|
725
|
+
* the buyer is). Show the message (`err.message`), for example "Purchases aren't available in
|
|
726
|
+
* your country yet. Nothing was charged." Returned by the quote, the purchase, hosted checkout
|
|
727
|
+
* and Platform Commerce card purchases. Branch on this, never on a country list.
|
|
728
|
+
* See https://docs.invo.network/docs/merchant-of-record-tax#sale-not-available
|
|
729
|
+
*/
|
|
730
|
+
get isSaleNotAvailableInCountry() {
|
|
731
|
+
return this.code === "SALE_NOT_AVAILABLE_IN_COUNTRY";
|
|
732
|
+
}
|
|
733
|
+
/** On `SALE_NOT_AVAILABLE_IN_COUNTRY`: the buyer's country, ISO 3166-1 alpha-2 (`country`), or
|
|
734
|
+
* `undefined` when INVO did not know it. */
|
|
735
|
+
get unavailableCountry() {
|
|
736
|
+
if (!this.isSaleNotAvailableInCountry) return void 0;
|
|
737
|
+
const v = this.bodyObject()["country"];
|
|
738
|
+
return typeof v === "string" && v ? v : void 0;
|
|
739
|
+
}
|
|
720
740
|
/**
|
|
721
741
|
* True if a Platform Commerce refund targeted an order that was already refunded
|
|
722
742
|
* (409). Idempotent outcome — the original refund did happen, so treat this as
|
|
@@ -1982,6 +2002,39 @@ function toReportGameEventResult(raw, eventId) {
|
|
|
1982
2002
|
};
|
|
1983
2003
|
}
|
|
1984
2004
|
|
|
2005
|
+
// src/shared/tax-fields.ts
|
|
2006
|
+
function str3(v) {
|
|
2007
|
+
return v == null ? void 0 : String(v);
|
|
2008
|
+
}
|
|
2009
|
+
function includedTaxFields(raw) {
|
|
2010
|
+
const out = {};
|
|
2011
|
+
if (typeof raw["tax_included"] === "boolean") out.taxIncluded = raw["tax_included"];
|
|
2012
|
+
const inc = str3(raw["tax_included_usd"]);
|
|
2013
|
+
if (inc !== void 0) out.taxIncludedUsd = inc;
|
|
2014
|
+
const display = str3(raw["tax_price_display"]);
|
|
2015
|
+
if (display !== void 0) out.taxPriceDisplay = display;
|
|
2016
|
+
const label = str3(raw["tax_label"]);
|
|
2017
|
+
if (label !== void 0) out.taxLabel = label;
|
|
2018
|
+
const line = str3(raw["tax_line"]);
|
|
2019
|
+
if (line !== void 0) out.taxLine = line;
|
|
2020
|
+
return out;
|
|
2021
|
+
}
|
|
2022
|
+
function includedTaxBreakdownFields(raw) {
|
|
2023
|
+
const out = includedTaxFields(raw);
|
|
2024
|
+
const added = str3(raw["tax_added_usd"]);
|
|
2025
|
+
if (added !== void 0) out.taxAddedUsd = added;
|
|
2026
|
+
return out;
|
|
2027
|
+
}
|
|
2028
|
+
function includedTaxPurchaseFields(raw) {
|
|
2029
|
+
const out = includedTaxFields(raw);
|
|
2030
|
+
if (out.taxIncluded !== true) return out;
|
|
2031
|
+
const tax = str3(raw["tax_usd"]);
|
|
2032
|
+
if (tax !== void 0) out.taxUsd = tax;
|
|
2033
|
+
if (Object.prototype.hasOwnProperty.call(raw, "tax_jurisdiction")) out.taxJurisdiction = str3(raw["tax_jurisdiction"]) ?? null;
|
|
2034
|
+
if (Object.prototype.hasOwnProperty.call(raw, "tax_rate_pct")) out.taxRatePct = str3(raw["tax_rate_pct"]) ?? null;
|
|
2035
|
+
return out;
|
|
2036
|
+
}
|
|
2037
|
+
|
|
1985
2038
|
// src/shared/phone-change.ts
|
|
1986
2039
|
function requireField(value, field, raw) {
|
|
1987
2040
|
const s = value == null ? "" : String(value);
|
|
@@ -1995,16 +2048,16 @@ function requireField(value, field, raw) {
|
|
|
1995
2048
|
}
|
|
1996
2049
|
return s;
|
|
1997
2050
|
}
|
|
1998
|
-
var
|
|
2051
|
+
var str4 = (v) => v == null ? "" : String(v);
|
|
1999
2052
|
var strOrNull2 = (v) => typeof v === "string" ? v : v == null ? null : String(v);
|
|
2000
2053
|
function toRequestPhoneChangeResult(raw) {
|
|
2001
2054
|
return {
|
|
2002
2055
|
changeRequestId: requireField(raw["change_request_id"], "change_request_id", raw),
|
|
2003
2056
|
status: requireField(raw["status"], "status", raw),
|
|
2004
|
-
expiresAt:
|
|
2005
|
-
delivery:
|
|
2006
|
-
confirmation:
|
|
2007
|
-
message:
|
|
2057
|
+
expiresAt: str4(raw["expires_at"]),
|
|
2058
|
+
delivery: str4(raw["delivery"]),
|
|
2059
|
+
confirmation: str4(raw["confirmation"]),
|
|
2060
|
+
message: str4(raw["message"]),
|
|
2008
2061
|
raw
|
|
2009
2062
|
};
|
|
2010
2063
|
}
|
|
@@ -2012,8 +2065,8 @@ function toPhoneChangeRequest(raw) {
|
|
|
2012
2065
|
return {
|
|
2013
2066
|
changeRequestId: requireField(raw["change_request_id"], "change_request_id", raw),
|
|
2014
2067
|
status: requireField(raw["status"], "status", raw),
|
|
2015
|
-
confirmation:
|
|
2016
|
-
delivery:
|
|
2068
|
+
confirmation: str4(raw["confirmation"]),
|
|
2069
|
+
delivery: str4(raw["delivery"]),
|
|
2017
2070
|
newPhoneMasked: strOrNull2(raw["new_phone_masked"]),
|
|
2018
2071
|
createdAt: strOrNull2(raw["created_at"]),
|
|
2019
2072
|
expiresAt: strOrNull2(raw["expires_at"]),
|
|
@@ -2024,7 +2077,7 @@ function toPhoneChangeRequest(raw) {
|
|
|
2024
2077
|
}
|
|
2025
2078
|
|
|
2026
2079
|
// src/version.ts
|
|
2027
|
-
var SDK_VERSION = "3.
|
|
2080
|
+
var SDK_VERSION = "3.38.0";
|
|
2028
2081
|
|
|
2029
2082
|
// src/payouts.ts
|
|
2030
2083
|
var AMOUNT = /^\d+(\.\d{1,2})?$/;
|
|
@@ -2376,6 +2429,7 @@ function toQuoteBreakdown(row) {
|
|
|
2376
2429
|
totalUsd: String(r["total_usd"] ?? ""),
|
|
2377
2430
|
coins: String(r["coins"] ?? ""),
|
|
2378
2431
|
currencyName: String(r["currency_name"] ?? ""),
|
|
2432
|
+
...includedTaxBreakdownFields(r),
|
|
2379
2433
|
raw: r
|
|
2380
2434
|
};
|
|
2381
2435
|
}
|
|
@@ -4599,6 +4653,7 @@ var InvoServer = class {
|
|
|
4599
4653
|
chargeTotalUsd: optionalDecimalString(raw["charge_total_usd"]),
|
|
4600
4654
|
...pricingFields(raw),
|
|
4601
4655
|
...receiptFields(raw),
|
|
4656
|
+
...includedTaxPurchaseFields(raw),
|
|
4602
4657
|
raw
|
|
4603
4658
|
};
|
|
4604
4659
|
}
|
|
@@ -4619,8 +4674,14 @@ var InvoServer = class {
|
|
|
4619
4674
|
* accepted. Card purchases only; purchases through a third-party storefront or payment
|
|
4620
4675
|
* rail are unaffected.
|
|
4621
4676
|
*
|
|
4677
|
+
* Merchant of Record: in the US tax is added on top (`totalUsd` above the price); outside the
|
|
4678
|
+
* US the price includes the tax, and `breakdown.taxIncluded` is `true` with
|
|
4679
|
+
* `breakdown.taxLine` ("Includes VAT 20% ($1.67)") to show under `totalUsd`.
|
|
4680
|
+
*
|
|
4622
4681
|
* Refusals: `400 INVALID_INPUT` (amount missing, not above zero, or above INVO's card
|
|
4623
|
-
* maximum), `400 CURRENCY_NOT_CONFIGURED`, `503 RATE_UNAVAILABLE
|
|
4682
|
+
* maximum), `400 CURRENCY_NOT_CONFIGURED`, `503 RATE_UNAVAILABLE`, and on Merchant of Record
|
|
4683
|
+
* `409 SALE_NOT_AVAILABLE_IN_COUNTRY` (`err.isSaleNotAvailableInCountry`) for a buyer in a
|
|
4684
|
+
* country where INVO does not yet sell as Merchant of Record.
|
|
4624
4685
|
*/
|
|
4625
4686
|
async quoteCurrencyPurchase(input, opts) {
|
|
4626
4687
|
assertUsdAmount(input.usdAmount);
|
package/dist/game-server.d.cts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { I as InvoServer, a as InvoEnvironment } from './server-
|
|
2
|
-
export { D as DEMO_KEY_PREFIX, E as EnvironmentUnknownError, K as KeyEnvironmentMismatchError, L as LIVE_KEY_PREFIX, P as PRODUCTION_BASE_URL, S as SANDBOX_BASE_URL, T as TEST_KEY_PREFIX, b as baseUrlForKey, e as environmentForBaseUrl, c as environmentFromKeyPrefix, i as isDemoKey, r as resolveEnvironment, v as verifyInvoSignature } from './server-
|
|
1
|
+
import { I as InvoServer, a as InvoEnvironment } from './server-BWGl9v5j.cjs';
|
|
2
|
+
export { D as DEMO_KEY_PREFIX, E as EnvironmentUnknownError, K as KeyEnvironmentMismatchError, L as LIVE_KEY_PREFIX, P as PRODUCTION_BASE_URL, S as SANDBOX_BASE_URL, T as TEST_KEY_PREFIX, b as baseUrlForKey, e as environmentForBaseUrl, c as environmentFromKeyPrefix, i as isDemoKey, r as resolveEnvironment, v as verifyInvoSignature } from './server-BWGl9v5j.cjs';
|
|
3
3
|
import { G as GameCurrencyKind, a as GamePurchaseStatus, b as GameEconomyConfig } from './types-jUxfYjiD.cjs';
|
|
4
4
|
export { c as GameCatalog, d as GameCatalogItem, e as GameCheckout, f as GameCurrencyBalance, g as GameErrorBody, h as GameItemPurchase, i as GamePlayer, j as GamePremiumPack, k as GamePurchase, l as GameSession, m as GameTransferInput, n as GameTransferKind, o as GameTransferStart, p as GameTransferStatus, q as GameWallet } from './types-jUxfYjiD.cjs';
|
|
5
|
-
export { I as InvoError } from './types-
|
|
6
|
-
export { S as SDK_VERSION } from './version-
|
|
5
|
+
export { I as InvoError } from './types-DGgWWX1v.cjs';
|
|
6
|
+
export { S as SDK_VERSION } from './version-D_cJUvMp.cjs';
|
|
7
7
|
import './loyalty-events-CmDw2ZoR.cjs';
|
|
8
8
|
|
|
9
9
|
interface StoredPlayer {
|
package/dist/game-server.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { I as InvoServer, a as InvoEnvironment } from './server-
|
|
2
|
-
export { D as DEMO_KEY_PREFIX, E as EnvironmentUnknownError, K as KeyEnvironmentMismatchError, L as LIVE_KEY_PREFIX, P as PRODUCTION_BASE_URL, S as SANDBOX_BASE_URL, T as TEST_KEY_PREFIX, b as baseUrlForKey, e as environmentForBaseUrl, c as environmentFromKeyPrefix, i as isDemoKey, r as resolveEnvironment, v as verifyInvoSignature } from './server-
|
|
1
|
+
import { I as InvoServer, a as InvoEnvironment } from './server-CaaP-Nc3.js';
|
|
2
|
+
export { D as DEMO_KEY_PREFIX, E as EnvironmentUnknownError, K as KeyEnvironmentMismatchError, L as LIVE_KEY_PREFIX, P as PRODUCTION_BASE_URL, S as SANDBOX_BASE_URL, T as TEST_KEY_PREFIX, b as baseUrlForKey, e as environmentForBaseUrl, c as environmentFromKeyPrefix, i as isDemoKey, r as resolveEnvironment, v as verifyInvoSignature } from './server-CaaP-Nc3.js';
|
|
3
3
|
import { G as GameCurrencyKind, a as GamePurchaseStatus, b as GameEconomyConfig } from './types-jUxfYjiD.js';
|
|
4
4
|
export { c as GameCatalog, d as GameCatalogItem, e as GameCheckout, f as GameCurrencyBalance, g as GameErrorBody, h as GameItemPurchase, i as GamePlayer, j as GamePremiumPack, k as GamePurchase, l as GameSession, m as GameTransferInput, n as GameTransferKind, o as GameTransferStart, p as GameTransferStatus, q as GameWallet } from './types-jUxfYjiD.js';
|
|
5
|
-
export { I as InvoError } from './types-
|
|
6
|
-
export { S as SDK_VERSION } from './version-
|
|
5
|
+
export { I as InvoError } from './types-DGgWWX1v.js';
|
|
6
|
+
export { S as SDK_VERSION } from './version-D_cJUvMp.js';
|
|
7
7
|
import './loyalty-events-CmDw2ZoR.js';
|
|
8
8
|
|
|
9
9
|
interface StoredPlayer {
|
package/dist/game-server.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { isDemoKey, SANDBOX_BASE_URL, environmentFromKeyPrefix, assertKeyMatchesEnvironment, assertKeyMatchesBaseUrl, PRODUCTION_BASE_URL, InvoServer, resolveEnvironment, verifyWebhook } from './chunk-
|
|
2
|
-
export { DEMO_KEY_PREFIX, EnvironmentUnknownError, InvoServer, KeyEnvironmentMismatchError, LIVE_KEY_PREFIX, PRODUCTION_BASE_URL, SANDBOX_BASE_URL, TEST_KEY_PREFIX, baseUrlForKey, environmentForBaseUrl, environmentFromKeyPrefix, isDemoKey, resolveEnvironment, verifyInvoSignature } from './chunk-
|
|
3
|
-
export { SDK_VERSION } from './chunk-
|
|
4
|
-
import { InvoError } from './chunk-
|
|
5
|
-
export { InvoError } from './chunk-
|
|
1
|
+
import { isDemoKey, SANDBOX_BASE_URL, environmentFromKeyPrefix, assertKeyMatchesEnvironment, assertKeyMatchesBaseUrl, PRODUCTION_BASE_URL, InvoServer, resolveEnvironment, verifyWebhook } from './chunk-NS33T5FB.js';
|
|
2
|
+
export { DEMO_KEY_PREFIX, EnvironmentUnknownError, InvoServer, KeyEnvironmentMismatchError, LIVE_KEY_PREFIX, PRODUCTION_BASE_URL, SANDBOX_BASE_URL, TEST_KEY_PREFIX, baseUrlForKey, environmentForBaseUrl, environmentFromKeyPrefix, isDemoKey, resolveEnvironment, verifyInvoSignature } from './chunk-NS33T5FB.js';
|
|
3
|
+
export { SDK_VERSION } from './chunk-MOHWLDOQ.js';
|
|
4
|
+
import { InvoError } from './chunk-7B7MFAQ3.js';
|
|
5
|
+
export { InvoError } from './chunk-7B7MFAQ3.js';
|
|
6
6
|
import { createHash, randomBytes } from 'crypto';
|
|
7
7
|
import { promises, readFileSync, mkdirSync, writeFileSync } from 'fs';
|
|
8
8
|
import * as path from 'path';
|
package/dist/game.cjs
CHANGED
|
@@ -545,6 +545,26 @@ var InvoError = class _InvoError extends Error {
|
|
|
545
545
|
const v = this.bodyObject()["untaxed_total_usd"];
|
|
546
546
|
return typeof v === "string" && v ? v : void 0;
|
|
547
547
|
}
|
|
548
|
+
/**
|
|
549
|
+
* Additive (3.38.0). True when a Merchant of Record card sale was refused because the buyer is in
|
|
550
|
+
* a country where INVO does not yet sell as Merchant of Record (`SALE_NOT_AVAILABLE_IN_COUNTRY`,
|
|
551
|
+
* 409; today the EU member states until January 1, 2027). NOTHING WAS CHARGED. The body carries
|
|
552
|
+
* `retryable: false`: do not retry, and do not ask for another card (the refusal follows where
|
|
553
|
+
* the buyer is). Show the message (`err.message`), for example "Purchases aren't available in
|
|
554
|
+
* your country yet. Nothing was charged." Returned by the quote, the purchase, hosted checkout
|
|
555
|
+
* and Platform Commerce card purchases. Branch on this, never on a country list.
|
|
556
|
+
* See https://docs.invo.network/docs/merchant-of-record-tax#sale-not-available
|
|
557
|
+
*/
|
|
558
|
+
get isSaleNotAvailableInCountry() {
|
|
559
|
+
return this.code === "SALE_NOT_AVAILABLE_IN_COUNTRY";
|
|
560
|
+
}
|
|
561
|
+
/** On `SALE_NOT_AVAILABLE_IN_COUNTRY`: the buyer's country, ISO 3166-1 alpha-2 (`country`), or
|
|
562
|
+
* `undefined` when INVO did not know it. */
|
|
563
|
+
get unavailableCountry() {
|
|
564
|
+
if (!this.isSaleNotAvailableInCountry) return void 0;
|
|
565
|
+
const v = this.bodyObject()["country"];
|
|
566
|
+
return typeof v === "string" && v ? v : void 0;
|
|
567
|
+
}
|
|
548
568
|
/**
|
|
549
569
|
* True if a Platform Commerce refund targeted an order that was already refunded
|
|
550
570
|
* (409). Idempotent outcome — the original refund did happen, so treat this as
|
|
@@ -5025,7 +5045,7 @@ function mountInvoUI(container, economy, options = {}) {
|
|
|
5025
5045
|
}
|
|
5026
5046
|
|
|
5027
5047
|
// src/version.ts
|
|
5028
|
-
var SDK_VERSION = "3.
|
|
5048
|
+
var SDK_VERSION = "3.38.0";
|
|
5029
5049
|
|
|
5030
5050
|
exports.InvoGameEconomy = InvoGameEconomy;
|
|
5031
5051
|
exports.InvoGameError = InvoGameError;
|
package/dist/game.d.cts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { i as GamePlayer, q as GameWallet, c as GameCatalog, k as GamePurchase, h as GameItemPurchase, n as GameTransferKind, d as GameCatalogItem, f as GameCurrencyBalance, p as GameTransferStatus, m as GameTransferInput, o as GameTransferStart } from './types-jUxfYjiD.cjs';
|
|
2
2
|
export { e as GameCheckout, G as GameCurrencyKind, b as GameEconomyConfig, g as GameErrorBody, j as GamePremiumPack, a as GamePurchaseStatus, l as GameSession } from './types-jUxfYjiD.cjs';
|
|
3
|
-
import { A as ApproveHostedResult } from './hosted-approval-
|
|
4
|
-
import { D as DestinationGame, P as PendingCollectItem } from './types-
|
|
5
|
-
export { S as SDK_VERSION } from './version-
|
|
3
|
+
import { A as ApproveHostedResult } from './hosted-approval-B-kbdFDL.cjs';
|
|
4
|
+
import { D as DestinationGame, P as PendingCollectItem } from './types-DGgWWX1v.cjs';
|
|
5
|
+
export { S as SDK_VERSION } from './version-D_cJUvMp.cjs';
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
8
|
* INVO game economy client (3.27.0), the browser half. It talks ONLY to your game server
|
package/dist/game.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { i as GamePlayer, q as GameWallet, c as GameCatalog, k as GamePurchase, h as GameItemPurchase, n as GameTransferKind, d as GameCatalogItem, f as GameCurrencyBalance, p as GameTransferStatus, m as GameTransferInput, o as GameTransferStart } from './types-jUxfYjiD.js';
|
|
2
2
|
export { e as GameCheckout, G as GameCurrencyKind, b as GameEconomyConfig, g as GameErrorBody, j as GamePremiumPack, a as GamePurchaseStatus, l as GameSession } from './types-jUxfYjiD.js';
|
|
3
|
-
import { A as ApproveHostedResult } from './hosted-approval-
|
|
4
|
-
import { D as DestinationGame, P as PendingCollectItem } from './types-
|
|
5
|
-
export { S as SDK_VERSION } from './version-
|
|
3
|
+
import { A as ApproveHostedResult } from './hosted-approval-CtAZ1Rzt.js';
|
|
4
|
+
import { D as DestinationGame, P as PendingCollectItem } from './types-DGgWWX1v.js';
|
|
5
|
+
export { S as SDK_VERSION } from './version-D_cJUvMp.js';
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
8
|
* INVO game economy client (3.27.0), the browser half. It talks ONLY to your game server
|
package/dist/game.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { InvoClient } from './chunk-
|
|
2
|
-
export { SDK_VERSION } from './chunk-
|
|
3
|
-
import { newEventId } from './chunk-
|
|
1
|
+
import { InvoClient } from './chunk-3HK32FE4.js';
|
|
2
|
+
export { SDK_VERSION } from './chunk-MOHWLDOQ.js';
|
|
3
|
+
import { newEventId } from './chunk-7B7MFAQ3.js';
|
|
4
4
|
|
|
5
5
|
// src/game/client.ts
|
|
6
6
|
var InvoGameError = class extends Error {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { A as ApproveResult, j as ConfirmReceiptResult } from './types-
|
|
1
|
+
import { A as ApproveResult, j as ConfirmReceiptResult } from './types-DGgWWX1v.cjs';
|
|
2
2
|
|
|
3
3
|
/** The four device-approval flows (`begin.flow`). */
|
|
4
4
|
type HostedFlow = "transfer" | "send" | "send_receipt" | "transfer_receipt";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { A as ApproveResult, j as ConfirmReceiptResult } from './types-
|
|
1
|
+
import { A as ApproveResult, j as ConfirmReceiptResult } from './types-DGgWWX1v.js';
|
|
2
2
|
|
|
3
3
|
/** The four device-approval flows (`begin.flow`). */
|
|
4
4
|
type HostedFlow = "transfer" | "send" | "send_receipt" | "transfer_receipt";
|
package/dist/index.cjs
CHANGED
|
@@ -545,6 +545,26 @@ var InvoError = class _InvoError extends Error {
|
|
|
545
545
|
const v = this.bodyObject()["untaxed_total_usd"];
|
|
546
546
|
return typeof v === "string" && v ? v : void 0;
|
|
547
547
|
}
|
|
548
|
+
/**
|
|
549
|
+
* Additive (3.38.0). True when a Merchant of Record card sale was refused because the buyer is in
|
|
550
|
+
* a country where INVO does not yet sell as Merchant of Record (`SALE_NOT_AVAILABLE_IN_COUNTRY`,
|
|
551
|
+
* 409; today the EU member states until January 1, 2027). NOTHING WAS CHARGED. The body carries
|
|
552
|
+
* `retryable: false`: do not retry, and do not ask for another card (the refusal follows where
|
|
553
|
+
* the buyer is). Show the message (`err.message`), for example "Purchases aren't available in
|
|
554
|
+
* your country yet. Nothing was charged." Returned by the quote, the purchase, hosted checkout
|
|
555
|
+
* and Platform Commerce card purchases. Branch on this, never on a country list.
|
|
556
|
+
* See https://docs.invo.network/docs/merchant-of-record-tax#sale-not-available
|
|
557
|
+
*/
|
|
558
|
+
get isSaleNotAvailableInCountry() {
|
|
559
|
+
return this.code === "SALE_NOT_AVAILABLE_IN_COUNTRY";
|
|
560
|
+
}
|
|
561
|
+
/** On `SALE_NOT_AVAILABLE_IN_COUNTRY`: the buyer's country, ISO 3166-1 alpha-2 (`country`), or
|
|
562
|
+
* `undefined` when INVO did not know it. */
|
|
563
|
+
get unavailableCountry() {
|
|
564
|
+
if (!this.isSaleNotAvailableInCountry) return void 0;
|
|
565
|
+
const v = this.bodyObject()["country"];
|
|
566
|
+
return typeof v === "string" && v ? v : void 0;
|
|
567
|
+
}
|
|
548
568
|
/**
|
|
549
569
|
* True if a Platform Commerce refund targeted an order that was already refunded
|
|
550
570
|
* (409). Idempotent outcome — the original refund did happen, so treat this as
|
package/dist/index.d.cts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { a as PurchaseStatusResult, b as PurchaseCredited, c as PurchaseExpired, d as PurchaseRefunded, e as PurchaseRefused, C as CheckoutClientConfig, H as Http, f as PurchaseStatusInput, g as CallOptions, W as WaitForPurchaseInput, M as MountCheckoutOptions, h as CheckoutMountHandle, i as ClientConfig, A as ApproveResult, j as ConfirmReceiptResult, k as PhoneChangeApprovalsResult, l as ApprovePhoneChangeInput, m as ApprovePhoneChangeResult, L as LinkDeviceResult, n as PendingCollectResult, o as DestinationsQuery, p as DestinationsResult, B as BalanceResult, q as LoyaltyCardsResult, r as LoyaltyVaultResult, R as RedeemRewardResult, s as RewardsPageLink, E as EnrollmentBeginResult, t as EnrollmentVerifyResult, u as RecoveryBeginResult, v as RecoveryCompleteResult } from './types-
|
|
2
|
-
export { w as BalanceRow, x as CheckoutPurchaseStatus, y as ClaimDelivery, D as DestinationGame, I as InvoError, z as InvoErrorInfo, F as InvoHooks, G as InvoRequestInfo, J as InvoResponseInfo, K as LoyaltyCard, N as LoyaltyCardReward, O as LoyaltyCardStep, Q as LoyaltyRewardState, S as LoyaltyStepProgress, T as LoyaltyStepState, U as LoyaltyVaultEntry, P as PendingCollectItem, V as PhoneChangeApproval, X as PhoneChangeDeviceSignal, Y as PurchaseRefusalReason, Z as Rail, _ as VerificationMethod } from './types-
|
|
3
|
-
import { a as ApproveHostedOptions, A as ApproveHostedResult } from './hosted-approval-
|
|
4
|
-
export { E as EnrollmentDecision, b as EnrollmentRespond, H as HostedApprovalStatus, c as HostedEnrollment, d as HostedEnrollmentInput, e as HostedFlow } from './hosted-approval-
|
|
1
|
+
import { a as PurchaseStatusResult, b as PurchaseCredited, c as PurchaseExpired, d as PurchaseRefunded, e as PurchaseRefused, C as CheckoutClientConfig, H as Http, f as PurchaseStatusInput, g as CallOptions, W as WaitForPurchaseInput, M as MountCheckoutOptions, h as CheckoutMountHandle, i as ClientConfig, A as ApproveResult, j as ConfirmReceiptResult, k as PhoneChangeApprovalsResult, l as ApprovePhoneChangeInput, m as ApprovePhoneChangeResult, L as LinkDeviceResult, n as PendingCollectResult, o as DestinationsQuery, p as DestinationsResult, B as BalanceResult, q as LoyaltyCardsResult, r as LoyaltyVaultResult, R as RedeemRewardResult, s as RewardsPageLink, E as EnrollmentBeginResult, t as EnrollmentVerifyResult, u as RecoveryBeginResult, v as RecoveryCompleteResult } from './types-DGgWWX1v.cjs';
|
|
2
|
+
export { w as BalanceRow, x as CheckoutPurchaseStatus, y as ClaimDelivery, D as DestinationGame, I as InvoError, z as InvoErrorInfo, F as InvoHooks, G as InvoRequestInfo, J as InvoResponseInfo, K as LoyaltyCard, N as LoyaltyCardReward, O as LoyaltyCardStep, Q as LoyaltyRewardState, S as LoyaltyStepProgress, T as LoyaltyStepState, U as LoyaltyVaultEntry, P as PendingCollectItem, V as PhoneChangeApproval, X as PhoneChangeDeviceSignal, Y as PurchaseRefusalReason, Z as Rail, _ as VerificationMethod } from './types-DGgWWX1v.cjs';
|
|
3
|
+
import { a as ApproveHostedOptions, A as ApproveHostedResult } from './hosted-approval-B-kbdFDL.cjs';
|
|
4
|
+
export { E as EnrollmentDecision, b as EnrollmentRespond, H as HostedApprovalStatus, c as HostedEnrollment, d as HostedEnrollmentInput, e as HostedFlow } from './hosted-approval-B-kbdFDL.cjs';
|
|
5
5
|
import { R as ReportGameEventInput, a as ReportGameEventResult } from './loyalty-events-CmDw2ZoR.cjs';
|
|
6
6
|
export { G as GameEventType } from './loyalty-events-CmDw2ZoR.cjs';
|
|
7
7
|
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { a as PurchaseStatusResult, b as PurchaseCredited, c as PurchaseExpired, d as PurchaseRefunded, e as PurchaseRefused, C as CheckoutClientConfig, H as Http, f as PurchaseStatusInput, g as CallOptions, W as WaitForPurchaseInput, M as MountCheckoutOptions, h as CheckoutMountHandle, i as ClientConfig, A as ApproveResult, j as ConfirmReceiptResult, k as PhoneChangeApprovalsResult, l as ApprovePhoneChangeInput, m as ApprovePhoneChangeResult, L as LinkDeviceResult, n as PendingCollectResult, o as DestinationsQuery, p as DestinationsResult, B as BalanceResult, q as LoyaltyCardsResult, r as LoyaltyVaultResult, R as RedeemRewardResult, s as RewardsPageLink, E as EnrollmentBeginResult, t as EnrollmentVerifyResult, u as RecoveryBeginResult, v as RecoveryCompleteResult } from './types-
|
|
2
|
-
export { w as BalanceRow, x as CheckoutPurchaseStatus, y as ClaimDelivery, D as DestinationGame, I as InvoError, z as InvoErrorInfo, F as InvoHooks, G as InvoRequestInfo, J as InvoResponseInfo, K as LoyaltyCard, N as LoyaltyCardReward, O as LoyaltyCardStep, Q as LoyaltyRewardState, S as LoyaltyStepProgress, T as LoyaltyStepState, U as LoyaltyVaultEntry, P as PendingCollectItem, V as PhoneChangeApproval, X as PhoneChangeDeviceSignal, Y as PurchaseRefusalReason, Z as Rail, _ as VerificationMethod } from './types-
|
|
3
|
-
import { a as ApproveHostedOptions, A as ApproveHostedResult } from './hosted-approval-
|
|
4
|
-
export { E as EnrollmentDecision, b as EnrollmentRespond, H as HostedApprovalStatus, c as HostedEnrollment, d as HostedEnrollmentInput, e as HostedFlow } from './hosted-approval-
|
|
1
|
+
import { a as PurchaseStatusResult, b as PurchaseCredited, c as PurchaseExpired, d as PurchaseRefunded, e as PurchaseRefused, C as CheckoutClientConfig, H as Http, f as PurchaseStatusInput, g as CallOptions, W as WaitForPurchaseInput, M as MountCheckoutOptions, h as CheckoutMountHandle, i as ClientConfig, A as ApproveResult, j as ConfirmReceiptResult, k as PhoneChangeApprovalsResult, l as ApprovePhoneChangeInput, m as ApprovePhoneChangeResult, L as LinkDeviceResult, n as PendingCollectResult, o as DestinationsQuery, p as DestinationsResult, B as BalanceResult, q as LoyaltyCardsResult, r as LoyaltyVaultResult, R as RedeemRewardResult, s as RewardsPageLink, E as EnrollmentBeginResult, t as EnrollmentVerifyResult, u as RecoveryBeginResult, v as RecoveryCompleteResult } from './types-DGgWWX1v.js';
|
|
2
|
+
export { w as BalanceRow, x as CheckoutPurchaseStatus, y as ClaimDelivery, D as DestinationGame, I as InvoError, z as InvoErrorInfo, F as InvoHooks, G as InvoRequestInfo, J as InvoResponseInfo, K as LoyaltyCard, N as LoyaltyCardReward, O as LoyaltyCardStep, Q as LoyaltyRewardState, S as LoyaltyStepProgress, T as LoyaltyStepState, U as LoyaltyVaultEntry, P as PendingCollectItem, V as PhoneChangeApproval, X as PhoneChangeDeviceSignal, Y as PurchaseRefusalReason, Z as Rail, _ as VerificationMethod } from './types-DGgWWX1v.js';
|
|
3
|
+
import { a as ApproveHostedOptions, A as ApproveHostedResult } from './hosted-approval-CtAZ1Rzt.js';
|
|
4
|
+
export { E as EnrollmentDecision, b as EnrollmentRespond, H as HostedApprovalStatus, c as HostedEnrollment, d as HostedEnrollmentInput, e as HostedFlow } from './hosted-approval-CtAZ1Rzt.js';
|
|
5
5
|
import { R as ReportGameEventInput, a as ReportGameEventResult } from './loyalty-events-CmDw2ZoR.js';
|
|
6
6
|
export { G as GameEventType } from './loyalty-events-CmDw2ZoR.js';
|
|
7
7
|
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { CheckoutClient, InvoClient, PlatformCommerceClient } from './chunk-
|
|
2
|
-
export { InvoError, isPurchaseCredited, isPurchaseExpired, isPurchaseRefunded, isPurchaseRefused, nothingWasCharged, phoneChangeSignalMessage } from './chunk-
|
|
1
|
+
export { CheckoutClient, InvoClient, PlatformCommerceClient } from './chunk-3HK32FE4.js';
|
|
2
|
+
export { InvoError, isPurchaseCredited, isPurchaseExpired, isPurchaseRefunded, isPurchaseRefused, nothingWasCharged, phoneChangeSignalMessage } from './chunk-7B7MFAQ3.js';
|
|
3
3
|
//# sourceMappingURL=index.js.map
|
|
4
4
|
//# sourceMappingURL=index.js.map
|