代码是这个
let token = require("DTSGInitialData").token || document.querySelector('[name="fb_dtsg"]').value;
let uid = require("CurrentUserInitialData").USER_ID;
let accountId = require("BusinessUnifiedNavigationContext").adAccountID;
let resp = await fetch("https://business.secure.facebook.com/ajax/payment/token_proxy.php?tpe=/api/graphql/", {
headers: {
"content-type": "application/x-www-form-urlencoded"
},
referrer: "https://www.business.facebook.com/",
body: av=${uid}&payment_dev_cycle=prod&__user=${uid}&__a=1&fb_dtsg=${token}&variables={"input":{"client_mutation_id":"3","actor_id":"${uid}","logging_data":{"logging_counter":21,"logging_id":""},"payment_account_id":"${accountId}"}}&server_timestamps=true&doc_id=3138742652811181
,
method: "POST",
mode: "cors",
credentials: "include"
});
let json = await resp.json();
if (json.errors!=null)
{
console.log("ERROR! Couldn't convert account to PREPAY! ");
}
else{
console.log("BINGO! You have a PREPAY account now! This page will reload in 3 seconds...");
setTimeout(()=>location.reload(),3000);
}