@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.
- package/examples/01-quickstart.ts +18 -13
- package/package.json +1 -1
|
@@ -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
|
-
//
|
|
50
|
-
//
|
|
51
|
-
//
|
|
52
|
-
//
|
|
53
|
-
//
|
|
54
|
-
//
|
|
55
|
-
//
|
|
56
|
-
//
|
|
57
|
-
//
|
|
58
|
-
//
|
|
59
|
-
// • deliveryData —
|
|
60
|
-
//
|
|
61
|
-
//
|
|
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
|
},
|