@gamecore-api/sdk 0.26.2 → 0.26.3

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.
@@ -46,25 +46,30 @@ console.log("picked product:", product.id, product.name, "price:", product.price
46
46
  // 4. Create checkout (guest — pass email; no Telegram/VK login required).
47
47
  // For balance-based payment, the user must be authenticated first.
48
48
  //
49
- // Item fields:
50
- // productId — REQUIRED, the supplier product
51
- // gameId — REQUIRED (despite being typed optional). It's
52
- // the game slug; the backend reads it directly to
53
- // route Steam top-ups, SuperPass bundles, and
54
- // Robux-via-pass through their special validation
55
- // paths. A missing `gameId` crashes the request.
56
- // amount — quantity for fixed-price items (default 1) OR
57
- // the top-up amount in local currency for Steam /
58
- // variable-amount products.
59
- // • deliveryData — product-specific fields (account name, server
60
- // id, etc.). For simple gift cards this can be
61
- // an empty object.
49
+ // The SDK's `CheckoutRequest.items` type currently marks several
50
+ // fields optional, but the API's body schema (TypeBox) rejects
51
+ // requests that omit them:
52
+ // productId — REQUIRED, the supplier product
53
+ // gameId — REQUIRED, the game slug. Drives routing for
54
+ // Steam top-ups, SuperPass bundles, and
55
+ // Robux-via-pass; the backend also reads it
56
+ // directly outside those paths.
57
+ // gameName — REQUIRED by body validation (maxLength 500).
58
+ // productName — REQUIRED by body validation (maxLength 500).
59
+ // • deliveryData — REQUIRED object (can be `{}`). For Steam /
60
+ // Roblox / login-required products it carries
61
+ // account name, server id, top-up currency, etc.
62
+ // • amount — optional. Quantity for fixed-price items
63
+ // (default 1) OR the top-up amount in local
64
+ // currency for Steam / variable-amount products.
62
65
  const checkout = await gc.checkout.create({
63
66
  email: "buyer@example.com",
64
67
  items: [
65
68
  {
66
69
  productId: product.id,
67
70
  gameId: game.slug,
71
+ gameName: game.name,
72
+ productName: product.name,
68
73
  amount: 1,
69
74
  deliveryData: {},
70
75
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gamecore-api/sdk",
3
- "version": "0.26.2",
3
+ "version": "0.26.3",
4
4
  "description": "TypeScript SDK for GameCore API — browser-safe, zero dependencies",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",