Skip to content

Commit 9519cbc

Browse files
authored
Add files via upload
1 parent 1a9e994 commit 9519cbc

File tree

3 files changed

+97
-0
lines changed

3 files changed

+97
-0
lines changed

scr/Accept Payment.js

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
// ==UserScript==
2+
// @name Accept Payment
3+
// @namespace http://tampermonkey.net/
4+
// @version 0.1
5+
// @description Gets all pendent payments and accepts them
6+
// @author fiusen
7+
// @icon https://www.google.com/s2/favicons?domain=paypal.com
8+
// @match https://www.paypal.com/myaccount/activities/*
9+
// ==/UserScript==
10+
11+
function getAncestors(node) {
12+
var ancestors = [];
13+
while (node.parentNode) {
14+
ancestors.push(node.parentNode.className);
15+
node = node.parentNode;
16+
}
17+
return ancestors;
18+
}
19+
20+
21+
function getAcceptElements() {
22+
var aTags = document.getElementsByClassName("ppvx_row___2-7-9");
23+
var foundList = [];
24+
25+
for (var i = 0; i < aTags.length; i++) {
26+
if (aTags[i].className == "ppvx_row___2-7-9") {
27+
foundList.push(aTags[i]);
28+
}
29+
}
30+
31+
return foundList;
32+
}
33+
34+
function getDescendants(node) {
35+
var list = [], desc = node, checked = false, i = 0;
36+
do {
37+
checked || (list[i++] = desc);
38+
desc =
39+
(!checked && desc.firstChild) ||
40+
(checked = false, desc.nextSibling) ||
41+
(checked = true, desc.parentNode);
42+
} while (desc !== node);
43+
return list;
44+
}
45+
46+
(async () => {
47+
if (await GM.getValue("running")) close();
48+
var index = 0;
49+
GM.setValue("running", true);
50+
var values = [];
51+
var ancestors = getDescendants(getAcceptElements()[0]);
52+
for(var j = 0; j < ancestors.length; j++) {
53+
let o = ancestors[j];
54+
if(typeof(o.className) === "string" && o.className.includes("list_item")) {
55+
let id = o.className.replace("list_item js_transactionItem-", "");
56+
let href = "https://www.paypal.com/activity/actions/acceptdeny/edit/"+id;
57+
58+
window.open(href, '_blank').focus();
59+
await new Promise(r => setTimeout(r, 16000)); // so it doesnt break bc of the captcha
60+
}
61+
}
62+
})();

scr/Redirect.js

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
// ==UserScript==
2+
// @name Redirect
3+
// @namespace http://tampermonkey.net/
4+
// @version 0.1
5+
// @description Closes current payment window
6+
// @author fiusen
7+
// @match https://www.paypal.com/activity/actions/acceptdeny/accept/*
8+
// @icon https://www.google.com/s2/favicons?domain=paypal.com
9+
// ==/UserScript==
10+
11+
12+
(async () => {
13+
await new Promise(r => setTimeout(r, 2000));
14+
close();
15+
16+
17+
})();
18+

scr/Submit (Accept).js

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
// ==UserScript==
2+
// @name Submit (Accept)
3+
// @namespace http://tampermonkey.net/
4+
// @version 0.1
5+
// @description Submit "accept" button
6+
// @author fiusen
7+
// @match https://www.paypal.com/activity/actions/acceptdeny/edit/*
8+
// @icon https://www.google.com/s2/favicons?domain=paypal.com
9+
// ==/UserScript==
10+
11+
12+
(async () => {
13+
let d = document.getElementsByClassName("vx_btn")
14+
d[0].click();
15+
})();
16+
17+

0 commit comments

Comments
 (0)