@gamecore-api/sdk 0.26.1 → 0.26.2
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 +22 -4
- package/package.json +1 -1
|
@@ -45,12 +45,30 @@ 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
|
-
//
|
|
49
|
-
//
|
|
50
|
-
//
|
|
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.
|
|
51
62
|
const checkout = await gc.checkout.create({
|
|
52
63
|
email: "buyer@example.com",
|
|
53
|
-
items: [
|
|
64
|
+
items: [
|
|
65
|
+
{
|
|
66
|
+
productId: product.id,
|
|
67
|
+
gameId: game.slug,
|
|
68
|
+
amount: 1,
|
|
69
|
+
deliveryData: {},
|
|
70
|
+
},
|
|
71
|
+
],
|
|
54
72
|
paymentMethod: "antilopay", // gateway slug from checkout.getPaymentMethods()
|
|
55
73
|
});
|
|
56
74
|
|