SENPAY98K Posted February 1, 2023 Report Posted February 1, 2023 Hi, is it posible to add games to cart and buy with steam balance ? Tried it, but not sure if im skipping/missung other requests. // Add games to cart for (let i = 0; i < arrayGames.length; i++) { var gameID = Number(arrayGames[i]); logINFO(`gameID: ` + gameID); await addToCart(Steam, Community, sessionID, gameID); await SLEEP(5000); } // Get transaction id let purchaseId = await scrapTransactionID(Community); logINFO(purchaseId); // Buy games in cart await purchaseGames(Community, purchaseId); function addToCart(Steam, Community, sessionID, subid) { return new Promise((resolve) => { Community.httpRequestPost( `https://store.steampowered.com/cart/`, { form: { snr: "1_5_9__403", originating_snr: "1_direct-navigation__", action: "add_to_cart", sessionid: sessionID, subid: subid, }, headers: { Host: "store.steampowered.com", Origin: "https://store.steampowered.com", }, json: true, }, (err, res, body) => { if (!err && res.resposeCode == 200) { logINFO(`Success`); } else { logERROR(`Failed`); } } ); resolve(); }); } // func() function scrapTransactionID(Community) { return new Promise((resolve) => { Community.httpRequestPost( `https://store.steampowered.com/cart`, (err, res, body) => { if (!err) { let pattern = /https:\/\/store.steampowered.com\/checkout\/\?purchasetype=gift&cart=(\d+)&/; let match = body.match(pattern); if (match) { logINFO(`Matched: ` + match[1]); resolve(match[1]); } } } ); }); } //func() function purchaseGames(Community, purchaseId) { return new Promise((resolve) => { Community.httpRequestPost( `https://store.steampowered.com/checkout/finalizetransaction/`, { form: { transid: purchaseId, CardCVV2: "", browserInfo: { language: "en-US", javaEnabled: "false", colorDepth: 24, screenHeight: 600, screenWidth: 800, }, }, headers: { Host: "store.steampowered.com", Origin: "https://store.steampowered.com", Referer: `https://store.steampowered.com/checkout/?purchasetype=self&cart=${purchaseId}&snr=1_8_4__503`, }, json: true, }, (err, res, body) => { if (!err) { logINFO("success"); } } ); resolve(); }); } //func() Quote
vlk_pro Posted March 8 Report Posted March 8 heelo, did you handle this script ? im trying to add any game to cart and buy, but i can't ? Quote
SENPAY98K Posted March 8 Author Report Posted March 8 Just now, vlk_pro said: heelo, did you handle this script ? im trying to add any game to cart and buy, but i can't ? so much things changed on steam backend, but you can use ASF + ASFEnahanced plugin for less hassle Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.