Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
Fiusen committed Dec 22, 2022
1 parent 1a9e994 commit 9519cbc
Show file tree
Hide file tree
Showing 3 changed files with 97 additions and 0 deletions.
62 changes: 62 additions & 0 deletions scr/Accept Payment.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
// ==UserScript==
// @name Accept Payment
// @namespace http://tampermonkey.net/
// @version 0.1
// @description Gets all pendent payments and accepts them
// @author fiusen
// @icon https://www.google.com/s2/favicons?domain=paypal.com
// @match https://www.paypal.com/myaccount/activities/*
// ==/UserScript==

function getAncestors(node) {
var ancestors = [];
while (node.parentNode) {
ancestors.push(node.parentNode.className);
node = node.parentNode;
}
return ancestors;
}


function getAcceptElements() {
var aTags = document.getElementsByClassName("ppvx_row___2-7-9");
var foundList = [];

for (var i = 0; i < aTags.length; i++) {
if (aTags[i].className == "ppvx_row___2-7-9") {
foundList.push(aTags[i]);
}
}

return foundList;
}

function getDescendants(node) {
var list = [], desc = node, checked = false, i = 0;
do {
checked || (list[i++] = desc);
desc =
(!checked && desc.firstChild) ||
(checked = false, desc.nextSibling) ||
(checked = true, desc.parentNode);
} while (desc !== node);
return list;
}

(async () => {
if (await GM.getValue("running")) close();
var index = 0;
GM.setValue("running", true);
var values = [];
var ancestors = getDescendants(getAcceptElements()[0]);
for(var j = 0; j < ancestors.length; j++) {
let o = ancestors[j];
if(typeof(o.className) === "string" && o.className.includes("list_item")) {
let id = o.className.replace("list_item js_transactionItem-", "");
let href = "https://www.paypal.com/activity/actions/acceptdeny/edit/"+id;

window.open(href, '_blank').focus();
await new Promise(r => setTimeout(r, 16000)); // so it doesnt break bc of the captcha
}
}
})();
18 changes: 18 additions & 0 deletions scr/Redirect.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
// ==UserScript==
// @name Redirect
// @namespace http://tampermonkey.net/
// @version 0.1
// @description Closes current payment window
// @author fiusen
// @match https://www.paypal.com/activity/actions/acceptdeny/accept/*
// @icon https://www.google.com/s2/favicons?domain=paypal.com
// ==/UserScript==


(async () => {
await new Promise(r => setTimeout(r, 2000));
close();


})();

17 changes: 17 additions & 0 deletions scr/Submit (Accept).js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
// ==UserScript==
// @name Submit (Accept)
// @namespace http://tampermonkey.net/
// @version 0.1
// @description Submit "accept" button
// @author fiusen
// @match https://www.paypal.com/activity/actions/acceptdeny/edit/*
// @icon https://www.google.com/s2/favicons?domain=paypal.com
// ==/UserScript==


(async () => {
let d = document.getElementsByClassName("vx_btn")
d[0].click();
})();


0 comments on commit 9519cbc

Please sign in to comment.