Giter VIP home page Giter VIP logo

Comments (23)

jgoldhammer avatar jgoldhammer commented on September 14, 2024 1

Hi @uwe-schwarz,

danke für die Bereitstellung des Logfiles. Ich tippe ganz stark, dass die neue Pre-Release Version 1.1 (https://github.com/jgoldhammer/moneymoney-payback/releases/tag/v1.1) dein Problem lösen wird.
Da du diese Version nicht austesten kannst, werde ich die Version bei Herrn Haller einreichen. Ich update das Ticket, wenn die neue Version bei moneymoney-app auf der Extensionsseite erschienen ist. Ich bitte noch um etwas Geduld.

Danke,
Jens

from moneymoney-payback.

philwo avatar philwo commented on September 14, 2024

Ich habe das gleiche Problem seit ein paar Tagen.

"pull-right" zum xpath in Zeile 171 hinzuzufügen bringt einen zwar weiter, löst das Problem aber noch nicht ganz - dann findet er in Zeile 208 die pointRangeForm nicht...

from moneymoney-payback.

jgoldhammer avatar jgoldhammer commented on September 14, 2024

Hallo @uwe-schwarz und @philwo ,

ich kann das Problem bei mir nicht reproduzieren.
Könnt ihr mir daher eure Logfiles bereitstellen?

Danke,
Jens

from moneymoney-payback.

uwe-schwarz avatar uwe-schwarz commented on September 14, 2024

Das sollte das komplette Log sein.
payback.txt

from moneymoney-payback.

jgoldhammer avatar jgoldhammer commented on September 14, 2024

Habt ihr schon meine Version hier ausgetestet??
29e0ecc

@philwo - kannst du diese Version bitte testen?
Hintergrund:
Auf der Seite https://moneymoney-app.com/extensions/ ist noch eine ältere Version online.
Falls diese Version funktioniert, werde ich Herrn Haller von MoneyMoney bitten, die neue Version in die Seite https://moneymoney-app.com/extensions/ aufzunehmen.

Danke...

from moneymoney-payback.

jgoldhammer avatar jgoldhammer commented on September 14, 2024

Die neue Version ist online:
https://moneymoney-app.com/extensions/Payback-Punkte.lua

Bitte um Rückmeldung- danke!

from moneymoney-payback.

uwe-schwarz avatar uwe-schwarz commented on September 14, 2024

Das ging schnell, nun scheitert es aber an der nächsten Stelle: Payback-Punkte.lua:208: bad argument #1 to 'request' (string expected, got no value)

from moneymoney-payback.

philwo avatar philwo commented on September 14, 2024

Hi @jgoldhammer - vielen Dank für die neue Version!

Ich habe den gleichen Fehler wie @uwe-schwarz:
Payback-Punkte.lua:208: bad argument #1 to 'request' (string expected, got no value)

Brauchst du ein Logfile, oder kannst du das bei dir so reproduzieren?

from moneymoney-payback.

jgoldhammer avatar jgoldhammer commented on September 14, 2024

Hallo @philwo, hallo @uwe-schwarz ,

ich kann mir den Fehler bisher nicht erklären.
Könnt ihr euch bitte direkt in paypack über die Weboberfläche einloggen und bitt im Chrome über Developer Tools oder über Firefox prüfen, ob die pointRangeForm-ID an der Form zum Absenden des Formulars im HTML existiert?

image

Bitte schreibt mir außerdem die URL vom Browser, wenn ihr eingeloggt seid...

image

Im Logfile ist das leider nicht drin...

Danke,
Jens

from moneymoney-payback.

uwe-schwarz avatar uwe-schwarz commented on September 14, 2024

Im Browser (sowohl Safari als auch Chrome) ist das bei mir wie vorher (also ohne das pull-right und auch mit dem pointRangeForm), ich kann später mal versuchen MoneyMoney dazu zu überreden einen mitmproxy zu benutzen und dann kann ich dir mehr Infos geben. Die URL ist bei mir auch "https://www.payback.de/pb/punktekonto/id/13598/".

from moneymoney-payback.

uwe-schwarz avatar uwe-schwarz commented on September 14, 2024

So wie das für mich aussieht funktioniert der Login nicht.

Erster Request: curl -H 'host:www.payback.de' -H 'Connection:keep-alive' -H 'Accept:text/html,application/xhtml+xml,application/xml;q=0.9,/;q=0.8' -H 'User-Agent:Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_4) AppleWebKit/601.5.17 (KHTML, like Gecko) Version/9.1 Safari/601.5.17' -H 'Referer:https://www.payback.de/pb/authenticate/id/713416/#loginSecureTab' -H 'Accept-Language:de-de' -H 'Accept-Encoding:gzip, deflate' 'https://www.payback.de/pb/authenticate/id/713416/'
-> liefert ein 200

Zweiter Request: curl -H 'host:www.payback.de' -H 'Content-Type:application/x-www-form-urlencoded' -H 'Origin:https://www.payback.de' -H 'Cookie:JSESSIONID=xxx; plg_sec=xxx; pd_cookie=''; notepad=x; __utma=x; __utmb=x; __utmc=x; __utmt=x; __utmv=x; __utmz=x; ga=x; gat=x; BIGipServerpool_pbde_prod_www=xxx' -H 'Content-Length:200' -H 'Connection:keep-alive' -H 'Accept:text/html,application/xhtml+xml,application/xml;q=0.9,/;q=0.8' -H 'User-Agent:Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_4) AppleWebKit/601.5.17 (KHTML, like Gecko) Version/9.1 Safari/601.5.17' -H 'Referer:https://www.payback.de/pb/authenticate/id/713416/#loginSecureTab' -H 'Accept-Language:de-de' -H 'Accept-Encoding:gzip, deflate' -X POST 'https://www.payback.de/pb/ww/authenticate.password.action' --data-binary 'model.alias=xxx&password=xxx&__checkbox_usePermLogin=true&usePermLogin=true&token=xxx&did=xxx&page_id=xxx&language=&cid=xxx&secToken='
(alles was nach session oder security Daten ausgesehen hat hab ich nun mal mit "xxx" ersetzt)
-> da kommt ein 302 auf https://www.payback.de/pb/authenticate/id/713416/#loginSecureTab
und ein Cookie, der nicht so prickelnd aussieht:
Set-Cookie: bbst="VERSION:==.1:,,.MEMBER:==.unknown:,,.LEVEL:==.strong:,,.CREATED:==.2016-05-14-14:,,.TOKEN:==.xxx"; Version=1; Max-Age=1800; Expires=Sat, 14-May-2016 12:41:46 GMT; Path=/; Secure; HttpOnly

Kannst du damit was anfangen oder soll ich dir mehr zur Verfügung stellen?

from moneymoney-payback.

uwe-schwarz avatar uwe-schwarz commented on September 14, 2024

Ich habe gerade mal mein Passwort geändert und die Kontenliste in MoneyMoney neu abgefragt, da kommt folgende Fehlermeldung: Payback-Punkte.lua: expected string for 'account.accountNumber'

from moneymoney-payback.

jgoldhammer avatar jgoldhammer commented on September 14, 2024

Hallo Uwe,
danke für deine Unterstützung. Ich kann den Fehler JETZT bei mir auch reproduzieren (evtl. durch die neue Version 1.1)- ich kümmere mich in den nächsten Tagen drum.

VG,
Jens

from moneymoney-payback.

jgoldhammer avatar jgoldhammer commented on September 14, 2024

Hallo zusammen,

ein kurzer Zwischenstand nach Debugging mit mitmproxy und der Webseite im Chrome:

  • Authentifizierung am payback Server über http request im moneymoney (lua http) schlägt fehl, obwohl die scheinbar "richtigen" Nutzdaten im Body mitgesendet werden. Ein Vergleich der Daten zeigt nur unterschiedliche Ids bei dem Token (ich denke, so etwas wie CSRF)
  • es gibt eine Reihe von Cookies, die über den Browser zusätzlich gesendet werden (UserID1, manchmal eine JSESSIONID_BB und mbox). Zusätzlich noch ein paar Tracking-Cookies...

image

Ich versuche jetzt herauszufinden,wie die Cookies erzeugt werden- z.B. UserID1 - das Cookie wird nicht vom Server gesetzt, jedenfalls sehe ich das in den Responses nicht. Gleichzeitig finde ich aber keinen clientseitigen Code zum Erzeugen der UserID1...

Habt ihr noch Ideen, wie ich das herausbekomme?

BTW, Payback schützt seine User nicht gegen Session Fixation (https://de.wikipedia.org/wiki/Session_Fixation)- die JSESSIONID wird beim Einloggen nicht erneuert...

from moneymoney-payback.

jgoldhammer avatar jgoldhammer commented on September 14, 2024

Hier noch die Formdaten:

image

from moneymoney-payback.

jgoldhammer avatar jgoldhammer commented on September 14, 2024

Die UserID1 wird über einen Request zu https://mpm.payback.de/js?wp_id=XXX generiert und wird scheinbar auch fürs Advertising benutzt...

from moneymoney-payback.

uwe-schwarz avatar uwe-schwarz commented on September 14, 2024

Gibt es hierzu was neues, @jgoldhammer?

from moneymoney-payback.

gharlan avatar gharlan commented on September 14, 2024

Gibt es hierzu was neues

Jetzt ja. Zumindest bei mir funktioniert es plötzlich wieder.

from moneymoney-payback.

jgoldhammer avatar jgoldhammer commented on September 14, 2024

Wow, bei mir leider nicht...

payback.lua:236: attempt to concatenate a nil value

from moneymoney-payback.

gharlan avatar gharlan commented on September 14, 2024

Ich war auch ganz überrascht. Hatte die Extension die ganze Zeit bei mir drin gelassen, und plötzlich kamen heute die ganzen fehlenden Umsätze rein.

Ich hatte damals auch (erfolglos) probiert, die Extension wieder zum laufen zu bringen, daher bin ich mir gerade nicht mehr sicher, ob bei mir nun noch Änderungen von mir drin sind, oder ob ich die wieder zurückgesetzt hatte.

Ich habe hier diese Version:

-- ---------------------------------------------------------------------------------------------------------------------
--
-- MoneyMoney Web Banking Extension
-- http://moneymoney-app.com/api/webbanking
--
--
-- The MIT License (MIT)
--
-- Copyright (c) 2012-2015 MRH applications GmbH
--
-- Permission is hereby granted, free of charge, to any person obtaining a copy
-- of this software and associated documentation files (the "Software"), to deal
-- in the Software without restriction, including without limitation the rights
-- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-- copies of the Software, and to permit persons to whom the Software is
-- furnished to do so, subject to the following conditions:
--
-- The above copyright notice and this permission notice shall be included in
-- all copies or substantial portions of the Software.
--
-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-- THE SOFTWARE.
--
-- ---------------------------------------------------------------------------------------------------------------------

-- ---------------------------------------------------------------------------------------------------------------------
--
-- Get portfolio of Payback online account.
--
-- ATTENTION: This extension requires MoneyMoney version 2.2.2 or higher
--
-- ---------------------------------------------------------------------------------------------------------------------


-- ---------------------------------------------------------------------------------------------------------------------
-- Common MoneyMoney extension informations
-- ---------------------------------------------------------------------------------------------------------------------

WebBanking {
    version = 1.1,
    country = "de",
    url = "https://www.payback.de/pb/authenticate/id/713416/",
    services    = {"Payback-Punkte"},
    description = string.format(MM.localizeText("Get points of %s"), "Payback account")
}

-- ---------------------------------------------------------------------------------------------------------------------
-- Helper functions
-- ---------------------------------------------------------------------------------------------------------------------

local function strToAmount(str)
    -- Helper function for converting localized amount strings to Lua numbers.
    print("raw value: ".. str)
    local convertedValue = string.gsub(string.gsub(string.gsub(str, " .+", ""), "%.", ""), ",", ".")
    print("converted value " .. convertedValue)
    return convertedValue
end

-- ---------------------------------------------------------------------------------------------------------------------

local function strToAmountWithDefault(str, defaultValue)
    -- Helper function for converting localized amount strings to Lua numbers with a default value.
    local value = strToAmount(str)
    if value == nil or value == "" then
        value = defaultValue
    end
    return value
end

-- ---------------------------------------------------------------------------------------------------------------------

local function strToDate(str)
    -- Helper function for converting localized date strings to timestamps.
    local d, m, y = string.match(str, "(%d%d)%.(%d%d)%.(%d%d%d%d)")
    if d and m and y then
        return os.time { year = y, month = m, day = d, hour = 0, min = 0, sec = 0 }
    end
end

-- ---------------------------------------------------------------------------------------------------------------------

local function printElementWithPrefix(prefix, element)
    -- Helper function  for debugging HTML elements with a prtinable prefix
    if element:children():length() >= 1 then
        element:children():each(function(index, element2)
            local newPrefix = prefix .. "-" .. index
            print(newPrefix .. "=" .. element2:text())
            printElementWithPrefix(newPrefix, element2)
        end)
    end
end

-- ---------------------------------------------------------------------------------------------------------------------


local function strToFullDate (str)
    -- Helper function for converting localized date strings to timestamps.
    local d, m, y = string.match(str, "(%d%d).(%d%d).(%d%d%d%d)")
    return os.time{year=y, month=m, day=d}
end

local function printElement(element)
    -- Helper function  for debugging HTML elements
    printElementWithPrefix('0', element)
end


-- ---------------------------------------------------------------------------------------------------------------------
-- The following variables are used to save state.
-- ---------------------------------------------------------------------------------------------------------------------

local connection
local overview_html


-- ---------------------------------------------------------------------------------------------------------------------
--
-- MoneyMoney API Extension
--
-- @see: http://moneymoney-app.com/api/webbanking/
--
-- ---------------------------------------------------------------------------------------------------------------------

function SupportsBank(protocol, bankCode)
    -- Using artificial bankcode to identify the DWS Investments group.
    return bankCode == "Payback-Punkte" and protocol == ProtocolWebBanking
end

-- ---------------------------------------------------------------------------------------------------------------------

function InitializeSession(protocol, bankCode, username, customer, password)

    print("InitializeSession with " .. protocol .. " connecting " .. url .. "with ".. username)
    MM.printStatus("Start to login...")

    -- Create HTTPS connection object.
    connection = Connection()
    connection.language = "de-de"

    -- Fetch login page.
    local loginPage = HTML(connection:get(url))

    -- Fill in login credentials.
    loginPage:xpath("//*[@id='aliasInputSecure']"):attr("value", username)
    loginPage:xpath("//*[@id='passwordInput']"):attr("value", password)

    MM.printStatus("parameters filled in ");

    -- Submit login form.
    local request = connection:request(loginPage:xpath("//input[@id='loginSubmitButtonSecure']"):click())

    MM.printStatus("request " ..request)
    overview_html = HTML(request)

    -- Check for failed login.
    local failure = overview_html:xpath("//*[@id='errorNotification']")
    if failure:length() > 0 then
        print("Login failed. Reason: " .. failure:xpath("//*p[@class='MsoNormal']"))
        MM.printStatus("Login failed...");
        return LoginFailed
    end

    MM.printStatus("Login success- go to correct paypack page ");

    -- hard coded point url ...
    overview_html = HTML(connection:get("https://www.payback.de/pb/punktekonto/id/13598/"))

    print("Session initialization completed successfully.")
    MM.printStatus("Login successfull...")
    return nil
end

-- ---------------------------------------------------------------------------------------------------------------------

function ListAccounts(knownAccounts)

    local accountNumber = overview_html:xpath("//p[text()='Kundennummer:']/span"):text();
    -- Supports only one account
    local account = {
        owner = overview_html:xpath("//*/p[@class='welcome-msg']/strong"):text(),
        name = "Paypack Punkte Konto (" .. accountNumber .. ")",
        accountNumber = accountNumber,
        portfolio = false,
        currency = "EUR",
        type = AccountTypeUnknown
    }

    return { account }
end

-- ---------------------------------------------------------------------------------------------------------------------

function RefreshAccount(account, since)
    local transactions = {}

    -- the datefields can be filled directly
    overview_html:xpath("//input[@id='date1']"):attr("value", os.date("%d.%m.%Y", since))
    overview_html:xpath("//input[@id='date2']"):attr("value", os.date("%d.%m.%Y"))

    MM.printStatus("Fill in date ranges")

    print("Submitting transaction search form for " .. account.accountNumber)
    overview_html = HTML(connection:request(overview_html:xpath("//form[@id='pointRangeForm']"):submit()))

    -- Get paypack points from text next to select box
    local balance = overview_html:xpath("//span[@id='serverPoints']"):text()
    -- eleminate the dot in the point number and divide it with 100 to get the euro equivalent
    balance = string.gsub(balance,"%.","")/100

    MM.printStatus("balance " .. balance)

    local firstPage =true;

    repeat
        local noMorePages = true;

        -- Check if the HTML table with transactions exists.
        if overview_html:xpath("//table[@class='mypoints']/tbody/tr[1]/td[1]"):length() > 0 then

            -- Extract transactions.
            overview_html:xpath("//table[@class='mypoints']/tbody/tr[position()>0]"):each(function (index, row)
                local columns = row:children()
                local transaction = {
                    valueDate   = strToFullDate(columns:get(1):text()),
                    bookingDate = strToFullDate(columns:get(1):text()),
                    name        = columns:get(2):text(),
                    purpose     = columns:get(3):text() .. " : " .. columns:get(4):text(), true,
                    currency    = "EUR",
                    amount      = strToAmount(columns:get(4):text(), true)/100
                }

                table.insert(transactions, transaction)
            end)


            local linkCounter
            if firstPage then
                linkCounter = 1
            else
                linkCounter = 2
            end


            local nextPageLink = overview_html:xpath("//div[@class='pager-list']/a[".. linkCounter .."]");

            -- check website for more pages to extract transactions for
            if  nextPageLink:length()> 0 then
                local link = overview_html:xpath("//div[@class='pager-list']/a[".. linkCounter .."]")
                overview_html = HTML(connection:request(overview_html:xpath("//div[@class='pager-list']/a[".. linkCounter .."]"):click()))
                noMorePages = false;
                firstPage=false;
                MM.printStatus("Getting more transactions...")
            end

        end
    until (noMorePages);

    -- Return balance and array of transactions.
    return {balance=balance, transactions=transactions, securities=nil}
end

-- ---------------------------------------------------------------------------------------------------------------------

function EndSession()

    -- Submit logout form.
    local logout_html = HTML(connection:request(overview_html:xpath("//a[@id='pbLogin']"):click()))

    print("Logged out successfully!")
end

-- SIGNATURE: MCwCFEi7zhrUhPNbur7MrkmyRnKlNOyLAhQae47rAv1jHMPSfjiORltSOUXyAg==

from moneymoney-payback.

gharlan avatar gharlan commented on September 14, 2024

Habe MoneyMoney in der Version 2.2.17 (284) Beta.

from moneymoney-payback.

gharlan avatar gharlan commented on September 14, 2024

Funktioniert weiterhin. Ich musste nun allerdings den Logout-Aufruf auskommentieren. Da wird umgeleitet zu https://www.payback.de/pb/id/314472/ und die Seite gibt dann einen 500er Fehler zurück. Dadurch bricht MoneyMoney dann aber ab.

Nach Auskommentieren funktioniert es aber wieder, es wird dann halt nicht korrekt ausgeloggt. Ist aber die Frage, ob das überhaupt notwendig ist.

from moneymoney-payback.

jgoldhammer avatar jgoldhammer commented on September 14, 2024

Logout-Funktion funktioniert bei mir wieder und auch der Abruf mit Version 2.1

from moneymoney-payback.

Related Issues (4)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.