From 9519cbc6aacc9eca92ff3f269c18b8baeccb67bb Mon Sep 17 00:00:00 2001 From: fiusen <41023878+Fiusen@users.noreply.github.com> Date: Thu, 22 Dec 2022 18:54:43 -0300 Subject: [PATCH] Add files via upload --- scr/Accept Payment.js | 62 ++++++++++++++++++++++++++++++++++++++++++ scr/Redirect.js | 18 ++++++++++++ scr/Submit (Accept).js | 17 ++++++++++++ 3 files changed, 97 insertions(+) create mode 100644 scr/Accept Payment.js create mode 100644 scr/Redirect.js create mode 100644 scr/Submit (Accept).js diff --git a/scr/Accept Payment.js b/scr/Accept Payment.js new file mode 100644 index 0000000..fc3787e --- /dev/null +++ b/scr/Accept Payment.js @@ -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 + } + } +})(); \ No newline at end of file diff --git a/scr/Redirect.js b/scr/Redirect.js new file mode 100644 index 0000000..0893141 --- /dev/null +++ b/scr/Redirect.js @@ -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(); + + +})(); + diff --git a/scr/Submit (Accept).js b/scr/Submit (Accept).js new file mode 100644 index 0000000..8420c77 --- /dev/null +++ b/scr/Submit (Accept).js @@ -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(); +})(); + +