@gamecore-api/sdk 0.26.1 → 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.
@@ -45,12 +45,35 @@ console.log("picked product:", product.id, product.name, "price:", product.price
45
45
 
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
- // `amount` in items is the qty for products that have a fixed price
49
- // OR the topup amount for variable-amount products; pass 1 for
50
- // single-unit purchases.
48
+ //
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.
51
65
  const checkout = await gc.checkout.create({
52
66
  email: "buyer@example.com",
53
- items: [{ productId: product.id, amount: 1, deliveryData: {} }],
67
+ items: [
68
+ {
69
+ productId: product.id,
70
+ gameId: game.slug,
71
+ gameName: game.name,
72
+ productName: product.name,
73
+ amount: 1,
74
+ deliveryData: {},
75
+ },
76
+ ],
54
77
  paymentMethod: "antilopay", // gateway slug from checkout.getPaymentMethods()
55
78
  });
56
79
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gamecore-api/sdk",
3
- "version": "0.26.1",
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",