UNPKG

koleksi-api

Version:
67 lines (65 loc) 1.76 kB
const axios = require('axios'); async function ffstalk(userId) { let data = { "voucherPricePoint.id": 8050, "voucherPricePoint.price": "", "voucherPricePoint.variablePrice": "", "email": "", "n": "", "userVariablePrice": "", "order.data.profile": "", "user.userId": userId, "voucherTypeName": "FREEFIRE", "affiliateTrackingId": "", "impactClickId": "", "checkoutId": "", "tmwAccessToken": "", "shopLang": "in_ID", } let ff = await axios({ "headers": { "Content-Type": "application/json; charset\u003dutf-8" }, "method": "POST", "url": "https://order.codashop.com/id/initPayment.action", "data": data }) return { id: userId, nickname: ff.data["confirmationFields"]["roles"][0]["role"] } } async function mlstalk(id, zoneId) { return new Promise(async (resolve, reject) => { axios .post( 'https://api.duniagames.co.id/api/transaction/v1/top-up/inquiry/store', new URLSearchParams( Object.entries({ productId: '1', itemId: '2', catalogId: '57', paymentId: '352', gameId: id, zoneId: zoneId, product_ref: 'REG', product_ref_denom: 'AE', }) ), { headers: { 'Content-Type': 'application/x-www-form-urlencoded', Referer: 'https://www.duniagames.co.id/', Accept: 'application/json', }, } ) .then((response) => { resolve(response.data.data.gameDetail) }) .catch((err) => { reject(err) }) }) } module.exports = { mlstalk, ffstalk }